Skip to content

Cannot get lesson 2 tests to initiate. #77

@Connor-Flewitt

Description

@Connor-Flewitt

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions