Catch this error after npm i. Version npm - 8.0.0, nodejs - 16.11.0.
npm ERR! Cannot read properties of undefined (reading 'isServer')
The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.
npm ERR! registry error parsing json Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. This can be caused by corporate proxies that give HTML responses to package.json requests.
Cannot read properties of undefined (reading 'stdin') npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Username\AppData\Local pm-cache\_logs\2022-02-194T16_18_33_034Z-debug-0.log
It's most likely a temporary npm registry glitch. Check npm server status and try again later. If the error persists, perhaps the published package is corrupt. Contact the package owner and have them publish a new version of the package. npm ERR!
Another option is to downgrade NPM to an older version. Downgrade NPM to the last know working version used to build your applications. Example to downgrade from 8.3.1 to 6.14.6 which was one of many working version of NPM installed. Then try to install npm@version again.
I had the same issue with close versions of node and npm. I was using a shared connection from my phone since I wasn't home. When I get back home and used my WiFi things got back to normal.
If you are using such kind of connection then it is probably that causes this issue.
Try to use npm with specific version
for example i was trying to use npm install -g truffle and it did not work
but this one work npm install -g [email protected]
I updated npm and that fixed it! You can update npm like so:
npm install -g npm@latest
If running this command doesn't work then you can try installing npm packages in an Admin Environment.
Hope this helps!
I've got the same issue, then I updated npm to 8.3.0, and the problem is solved.
Copying the npmrc.5 file from:
C:\Program Files\nodejs\node_modules\npm\man\man5
to C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm
seemed to work for me:
Copy-Item -Path C:\Program Files\nodejs\node_modules\npm\man\man5 -Destination C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm –Passthru
Try stable Nodejs version 14.16.1 instead of 16. Nodejs 14.16.1 Link
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