Webstorm throws an error when trying to run a command specified in package.json:
"devDependencies": {},
"scripts": {
"dev": "./node_modules/.bin/webpack-dev-server --content-base src --inline --hot",
"test": "echo \"Error: no test specified\" && exit 1"
},
I've used this script with Webstorm on other computers (Linux/Windows). On this one (Linux), it does not seem to work out of a sudden. It used to be fine. I've just upgraded Webstorm. From CLI, the 'dev'command works fine, it's something to do with Webstorm configuration. The In Settings => Languages & Frameworks => NOde.js and NPM the node interpreter is specified as /usr/bin/node which is the correct path. I also clicked to Enable Node.js Core library. Still in the NPM window on Webstorm, when I want to run the 'dev' script, it throws the above mentioned error. The project is a react project, if that matters.
In the past, it ran fine. Please advise.
Edit: Added a screenshot - Defaults
dev => Edit 'dev' settings:
NPM installs devDependencies within the package. json file. The 'npm install' command should add all the dependencies and devDependencies automatically during installation. If you need to add specific devDependencies to your project, you can use this command- 'npm install --save-dev'.
Ran into the same issue after upgrading from 11.0.3 to 2016.1. Not sure if some configuration was wrongly copied or if they added a new field to specify the npm package.
Go to
Run > Edit Configurations > Defaults > npm
Browse to select a Node interpreter, using the [...] button.
You should find the Npm package field, fill it with YOUR_PATH_TO_NODE/lib/node_modules/npm.
If it does not work right away, restart WebStorm so that it is taken into account.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With