Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve (reading 'isServer') error in npm?

Tags:

node.js

npm

Catch this error after npm i. Version npm - 8.0.0, nodejs - 16.11.0.

npm ERR! Cannot read properties of undefined (reading 'isServer')
like image 391
Ivan Kharkovsky Avatar asked Oct 18 '21 11:10

Ivan Kharkovsky


People also ask

Why npm install is showing error?

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.

Why is NPM err err error parsing JSON?

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.

Where can I find NPM err logs for undefined properties?

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

Why am I getting NPM err error when installing a package?

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!

How to fix NPM not installing on Windows?

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.


Video Answer


6 Answers

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.

like image 187
Klaymant Avatar answered Jan 03 '23 13:01

Klaymant


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]

like image 32
Tanjin Alam Avatar answered Jan 03 '23 13:01

Tanjin Alam


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!

like image 31
Dovi Rosner Avatar answered Jan 03 '23 12:01

Dovi Rosner


I've got the same issue, then I updated npm to 8.3.0, and the problem is solved.

like image 22
pokz Avatar answered Jan 03 '23 12:01

pokz


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

like image 42
bereket girma Avatar answered Jan 03 '23 12:01

bereket girma


Try stable Nodejs version 14.16.1 instead of 16. Nodejs 14.16.1 Link

like image 25
nipun-kavishka Avatar answered Jan 03 '23 12:01

nipun-kavishka