Error in installing npm --global in windows 10

Hi i have installed node.js in mylaptop on drive E, and then i have checked node --version && npm --version and it is telling v16 and give error i am now nota able to run node red on my laptop kindly see pick for reference

Please show the full error output including the command you used and the directory that it is run from.. Also please copy/paste rather than screenshot.

Also what do the commands
node -v
and
npm -v
show, and how did you install nodejs and npm? Have you used something like nvm or n to install them? If so then, unless you know what you are doing, that is generally not a good thing to do.

Hi kindly see the full error and command which i have used

What is the command you entered? (text not picture)


Also, please answer ↓



Also as already mentioned ↓

Please post TEXT not SCREENSHOTS! There are many reasons...

  1. screenshots can be hard to read.
  2. Screenshots cannot be searched.
  3. They are larger in KB than the text.
  4. We cannot copy text from a screenshot
  5. I could go on etc etc etc etc

I have used command( node --version && npm --version)
also the response of node -v is v16.17.0 and
npm -v showing following error
E:>npm -v
E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^

TypeError: Class extends value undefined is not a constructor or null
at Object. (E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (E:\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (E:\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110
class SocksProxyAgent extends agent_base_1.Agent {
^

TypeError: Class extends value undefined is not a constructor or null
at Object. (E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:110:44)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (E:\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:174:29)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (E:\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\remote.js:7:18)
at Module._compile (node:internal/modules/cjs/loader:1126:14)

A simple search of that alone reveals many hits...

https://www.google.com/search?q=npm+TypeError%3A+Class+extends+value+undefined+is+not+a+constructor+or+null

In short you have left over node_modules from a previous node install so you need to clean up. The recommend/ easy way is to uninstall node then reinstall node.

If that doesn't work, read the search results

do i need to uninstall node.js or anything else because i have done this before because at first time while powershell starts and do some updating installing and downloading after node.js complete is setup then my powershell crash and then i uninstall node.js and install it again on different directory

You may have multiple versions of nodejs/npm installed. You need to tidy that up and make sure you have completely removed them and any node_modules folders you have left lying about.

uninstall node.js if it lets you. Then delete E:\nodejs if it still exists. I think though that you may need to track down the global npm locations as normally they are elsewhere. But I've never installed node.js the way you have so I might be wrong.

Thanks everyone with help of you people i have solved the issue and what i did is following
I have uninstall node.js
deleted node.js folder from directory of E
also delete file from C\user\Appdata\node
then install node.js in C directory and now it is working

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.