The error is not package C: \ Program Files \ nodejs \ npm

I am new to node and npm and have been trying to update npm from version 1.4.3 o latest version. The procedure that I am doing for this is

go 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 you start

npm install npm

I get

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

npm ERR! addLocal Failed to 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! track 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 due to the fact that npm cannot find the file.

npm ERR! ENOENT

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

But after that, when I started

npm --version

he 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.

+5
source share
1 answer

I think the first error ( not a package ) is appropriate because npm looks at the file system and sees the npm command before it accesses the npm registry. You can get around this by running npm install npm@latest

It seems like a couple of mistakes. Here is what I would suggest:

If this does not work, send the PATH environment variable - you can print it from cmd.exe by running echo %PATH% at the > prompt or from bash terminal by running echo $PATH . There may be more than one npm installation in your path, which can damage things.

+7
source

Source: https://habr.com/ru/post/1210912/


All Articles