Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'npm-windows-upgrade' is not recognized as an internal or external command

Tags:

npm

windows

I ran

$ npm install --global --production npm-windows-upgrade

and it returned this positive looking feedback

├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], supports-color@2
.0.0, [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], cli-wi
[email protected], [email protected], [email protected], [email protected], [email protected].
0, [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], core-j
[email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], ut
[email protected], [email protected])

But when I run $ npm-windows-upgrade

I get

'$ npm-windows-upgrade' is not recognized as an internal or external command

I was following the directions here. Any idea what's going on? I've been googling it for a while and not getting much more than those basic instructions.

UPDATE Realized the issue was with everything I was trying to install globally. I thought the other packages I was trying to run worked but they did not. For example $ webpack returns the same error after installing it gloablly.

BACKGROUND

I'm running windows and had previously installed npm. When that started giving me all sorts of bugs I upgraded to npm3. I belive it was just

$ npm install npm3 -g

and then running all my commands starting with npm3, for example

$ npm3 install webpack --save

Today the same command gave me

'npm3' is not recognized as an internal or external command

So I tried to reinstall it with regular npm which gave me "'npm' ins not recognized..."

I was able to get npm working again after following these lovely instructions, but cannot figure out how to get back to version 3.

Also $ npm -v right now is 2.15.1

like image 800
spiffysparrow Avatar asked Jul 25 '16 22:07

spiffysparrow


1 Answers

To answer my own question.

The problem was my path settings. Npm itself was working, but for some reason the location where it was installing global node modules was in different directory. I saw this when I ran

$ npm install npm-windows-upgrade -g

The first few lines it prints when you install show where it is being installed.

I noticed it was being installed in

C:\Users\(my_username)\AppData\Roaming\npm\nodemodules\npm-windows-upgrade

even though I had just fixed npm by pointing it to

C:\ProgramFiles\npm

so I changed that to the npm location it was actually using to

C:\Users\(my_username)\AppData\Roaming\npm

restarted my computer and it worked.

Here again are instructions to change your path variables.

like image 141
spiffysparrow Avatar answered Sep 28 '22 07:09

spiffysparrow