Reputation: 3350
I've been working with Node.js/npm for a while, but I never used npm scripts. I was quite surprised to find that I can't get them to work at all on my Windows/Cygwin system. With a package.json like this ...
{
"name": "demo",
"scripts": {
"env": "env",
"hello": "echo Hello!",
"crap": "I am complete nonsense."
}
}
... all three npm run commands do nothing. npm run crap
executes and returns immediately with an OK status (I tested with the -dd parameter); npm run doesntexist
throws the expected error. Testing without Cygwin on the regular Windows shell made no difference.
Upvotes: 22
Views: 6793
Reputation: 3350
I finally found out myself. There is an npm setting with which you can stop all npm scripts from running. For some reason, my userconfig file ~/.npmrc contained the setting ignore-scripts = true
. If you run into this problem, check npm config list
.
Upvotes: 42