-
Notifications
You must be signed in to change notification settings - Fork 951
Description
I have installed yarn using yarn install
and checked it was successful using yarn version
. I then use yarn dev
within the CLI of visual studio, to build the project and start the server.
I then try to run yarn test-routes
to check my code against the test criteria (at this stage I haven't written any code, but I have the lesson 2 directory open in VS code, I just want to check the test is working), but receive the following error:
'Connors-MBP:api-design-node-v3-lesson-2 connorflewitt$ yarn test-routes
yarn run v1.22.15
$ npm run test -t router
npm WARN lifecycle The node binary used for scripts is /var/folders/x1/mz8mq97502566d0vm7_148d40000gn/T/yarn--1634049615107-0.4726967466122134/node but npm is using /usr/local/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.
[email protected] test /Users/connorflewitt/Documents/Learning Resources/api-design-node-v3-master/api-design-node-v3-lesson-2
cross-env NODE_ENV=testing jest --forceExit --detectOpenHandles --silent "router"
sh: cross-env: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] test: cross-env NODE_ENV=testing jest --forceExit --detectOpenHandles --silent "router"
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/connorflewitt/.npm/_logs/2021-10-12T14_40_15_531Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. '
Is anyone able to recreate and/or solve this issue?