When I try npm install
new packages it shows me this error:
<rollbackFailedOptional: verb npm-session 585aaecfe5f9a82
Make sure you can access the corporate repository you configured in npm is available.Check you VPN connection.
Else reset it back to default repository like below.
npm config set registry http://registry.npmjs.org/
Good Luck!!
The following commands resolved my issue:
npm config set proxy http://yourproxyurl.com:8080 (you need to enter your or your company proxy URL and 8080 should be replaced by your proxy port)
npm config set https-proxy http://yourproxyurl.com:8080
For Windows: Run the installer again and choose to 'Repair' the installation
Worked for me
I tried following options to fix this issue and it worked.
For example to install express I used following command.
npm install express --registry http://registry.npmjs.org/
or
npm install express -g --registry http://registry.npmjs.org/
If you want to install locally in any specific folder then use below command. Below command will install express on path C:\Sample\Example1
.
C:\Sample1\Example1> npm install /Sample/Example1 express --registry http://registry.npmjs.org/
Note: If you are installing locally in a specific location then first go to that directory using command and then run above command. If you are not inside that directory and giving only path in command that will not work.
If you get package.json
missing error then run below command before installing package locally
C:\Sample\Example1> npm init
above command will create package.json
file. No need to provide any data. just hit enter.
Note: If you are behind a firewall then you may need to set a proxy.
try this:
delete all file in folder: %APPDATA%\npm-cache\_locks
I had the same issue. But it can run properly with switching from company's internal network to visitor network.