So I have a package.json file which I used on a different computer to run javascript tests. Now I have moved to another computer, I have the node_modules folder, package.json, package-lock.json and yarn.lock. If I run npm install in the same folder where package.json is located, shouldn't jest also be installed? Since Jest is located in package.json. If I run jest from the terminal I get command not found
Asked
Active
Viewed 615 times
2 Answers
1
To use an npm package from anywhere you need to have it installed globally like this:
npm install -g jest
An other solloution would be to add a new script in the package.json like this:
scripts:{
"jest":"jest"
}
And the type npm run jest
You can also have a look at this question : How to use package installed locally in node_modules?

Manos Kounelakis
- 2,848
- 5
- 31
- 55
-
you are welcome hope it helped.If yes don't forget to upvote – Manos Kounelakis Jan 28 '19 at 11:17
1
Probably because the node_modules/.bin of your project is not in your $PATH
try adding it or run ./node_modules/.bin/jest

CharybdeBE
- 1,791
- 1
- 20
- 35