CMA
CMA

Reputation: 287

Ionic - npm is not recognized as an interal command, even with npm installed

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

Answers (2)

kavindu udhara
kavindu udhara

Reputation: 80

Download node.js

First of all Download and install node.js from here Nodejs.org

In windows 10

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

Reference: Fix ~ npm not recognized as internal or external command (Note: this is my own blog[include images also)

Upvotes: 0

Oscar Bout
Oscar Bout

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.

  1. npm i -g [email protected] (or try a few others if this one breaks)

  2. Deleting/renaming your package-lock.json makes the occasional difference.

  3. Delete node_modules and retype npm install

Those 3 work for me.

Upvotes: 1

Related Questions