5

I am new to node and npm and have been tryng to update npm from version 1.4.3 o the latest one. The procedure I am following to do this is

navigate to C:\Program Files (x86)\nodejs with cmd.exe and then run the installation without -g: npm install npm (from npm github)

The problem is that when I run

npm install npm

I get

npm ERR! not a package C:\Program Files\nodejs\npm

npm ERR! addLocal Could not install C:\Program Files\nodejs\npm

npm ERR! Windows_NT 6.2.9200

npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "npm"

npm ERR! node v0.10.30

npm ERR! npm v2.2.0

npm ERR! path C:\Users\ADMINI~1.PLA\AppData\Local\Temp\3\npm-9796-44646cae\unpack-c30e5ffdacdb\package.json

npm ERR! code ENOENT

npm ERR! errno 34

npm ERR! enoent ENOENT, open 'C:\Users\ADMINI~1.PLA\AppData\Local\Temp\3\npm-9796-44646cae\unpack-c30e5ffdacdb\package.json'

npm ERR! enoent This is most likely not a problem with npm itself

npm ERR! enoent and is related to npm not being able to find a file.

npm ERR! enoent

npm ERR! Please include the following file with any support request:

But after this when I run

npm --version

it shows me

N:\Program Files\nodejs>npm -v

2.2.0

but from some other folder it still shows me

N:\Program Files>npm -v

1.4.3

So, how can I fix this.

1 Answer 1

7

I think the first error (not a package) is coming because npm is looking at the filesystem and sees the npm command before it looks at the npm registry. You can work around that by running npm install npm@latest

It looks like a couple of things are wrong. Here's what I would suggest:

  1. Upgrade to the latest node (0.10.35) http://nodejs.org/download/

  2. Follow the npm update instructions from here: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows (though it looks like you are already doing this).

  3. Close and re-open your terminal (cmd.exe or bash) windows so that they definitely have the new PATH and the new npm.

If that doesn't work, please post your PATH environment variable - you can print this from cmd.exe by running echo %PATH% at the > prompt, or from a bash terminal by running echo $PATH. There may be more than one installation of npm in your path, which would mess things up.

Sign up to request clarification or add additional context in comments.

1 Comment

Great advice. Got to run it as admin, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.