I have a problem when installing any npm
packages. here is my error:
rollbackFailedOptional: verb npm-session xxxxxxxxxxx
for resolving this I do some stuff but I still get the same error.
I put registry=http://registry.npmjs.org/
in .npmrc
file in my user folder and also run following commands:
npm config rm proxy
npm config rm https-proxy
I try to solve the problem in node 8.11.1
and node 10.1.0
and my npm version is 5.6.0
.
Why this problem occurs and how can resolve that?
Update: npm config list:
; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.6.0 node/v8.11.1 win32 x64"
; userconfig C:\Users\me\.npmrc
https-proxy = "https://username:[email protected]:6050/"
proxy = "http://username:[email protected]:6050/"
registry = "http://registry.npmjs.org/"
; builtin config undefined
prefix = "C:\\Users\\me\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\me
; HOME = C:\Users\me
; "npm config ls -l" to show all defaults.
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.
I had resolved this identical issue by pointing the npm to the correct proxy when using a corporate machine. NO ADMIN REQUIRED!!!
Here are my steps:
Obtain the correct proxy by following these steps here! Copy/paste the proxy address into notepad. You will use this same proxy to set both the 'proxy' and 'proxy-https' params in the next step.
Execute the following 2 commands in your command window by replacing <contents> below with proxy address obtained in previous step:
NOTE: I ommitted 'username' and 'password' fields from the 'http://<username><password>@<proxy-server-url:port>' template which according to the source should work 9 out of 10 times, and worked perfectly for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With