Reputation: 287
I am running into a bit of trouble installing a couple ionic cordova native plugins.
Basically if I type npm
in my cmd I get the npm cli, if I type ionic
I get the ionic cli, if I type cordova
I get the cordova cli but:
If I type ionic cordova plugin add cordova-plugin-camera
I get Error: cmd: Command failed with exit code 1 Error output: 'C:\WINDOWS\system32\npm' is not recognized as an internal or external command, operable program or batch file.
C:\WINDOWS\system32\npm is not in my enviroment var path nor is nodejs or npm installed there, so why would the ionic cli look for it there?
Upvotes: 0
Views: 331
Reputation: 80
First of all Download and install node.js from here Nodejs.org
1. Go to My Computer properties
2. Click Advanced system settings
3. Now you are on System Properties window, Click advanced
4. Then, click Environment Variable button
5. From System Variable, Select Path
6. click Edit
7. At the end of the Variable value, add ;C:\Program Files\node.js\
8. Click Ok all the open dialogue box
Upvotes: 0
Reputation: 680
With Ionic the version of npm is very sensitive. Not all npm versions work, especially the latest (which ever) always give me troubles.
npm i -g [email protected] (or try a few others if this one breaks)
Deleting/renaming your package-lock.json makes the occasional difference.
Delete node_modules and retype npm install
Those 3 work for me.
Upvotes: 1