# Error in installing npm --global in windows 10

**URL:** https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942
**Category:** General
**Created:** [26 August 2022 05:03 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942 "2022-08-26T05:03:56Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![aminulhaq](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@aminulhaq](https://discourse.nodered.org/u/aminulhaq)
#### Post date: [26 August 2022 05:03 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/1 "2022-08-26T05:03:57Z")

</div>

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

 ![node red installation error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c77d98c967d93807071a619411c1a4aaf42ba22c.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [26 August 2022 06:48 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/2 "2022-08-26T06:48:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [26 August 2022 08:24 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/3 "2022-08-26T08:24:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![aminulhaq](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@aminulhaq](https://discourse.nodered.org/u/aminulhaq)
#### Post date: [26 August 2022 10:03 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/4 "2022-08-26T10:03:42Z")

</div>

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

 ![node red installation error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98d33a79c71f305f8e57d499467c2e67a10dbfd0.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 August 2022 10:10 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/5 "2022-08-26T10:10:14Z")

</div>

> [@aminulhaq](#):
>
> and command which i have used

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

  

Also, please answer ↓

> [@Colin](#):
>
> Also what do the commands  
> `node -v`  
> and  
> `npm -v`

  
  

Also as already mentioned ↓

> [@Colin](#):
>
> Also please copy/paste rather than screenshot

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

---

<div class="post-metadata">

### Author: ![aminulhaq](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@aminulhaq](https://discourse.nodered.org/u/aminulhaq)
#### Post date: [26 August 2022 10:17 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/6 "2022-08-26T10:17:23Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [26 August 2022 10:23 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/7 "2022-08-26T10:23:47Z")

</div>

> [@aminulhaq](#):
>
> TypeError: Class extends value undefined is not a constructor or null

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](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

---

<div class="post-metadata">

### Author: ![aminulhaq](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@aminulhaq](https://discourse.nodered.org/u/aminulhaq)
#### Post date: [26 August 2022 10:26 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/8 "2022-08-26T10:26:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [26 August 2022 10:46 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/9 "2022-08-26T10:46:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [26 August 2022 11:58 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/10 "2022-08-26T11:58:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![aminulhaq](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@aminulhaq](https://discourse.nodered.org/u/aminulhaq)
#### Post date: [27 August 2022 07:18 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/11 "2022-08-27T07:18:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 September 2022 07:18 UTC](https://discourse.nodered.org/t/error-in-installing-npm-global-in-windows-10/66942/12 "2022-09-10T07:18:55Z")

</div>

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