I am trying to get into Discord bot making, and I have node installed, version 17.3.0.
When I try to run npm init
in a blank folder on my desktop, it throws me this error:
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\bluep\AppData\Roaming\nvm\v14.15.4\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
It will throw me this error when I try to run any npm command. I have never seen any error like this before in this situation, and I haven't found any other person via google that's encountered this situation.
Any help is appreciated. I could be (probably am) overlooking something extremely simple and overthinking the f out of this.
CodePudding user response:
Update:
The issue ended up being there was an old install of Node on my computer that did not properly uninstall when I tried to uninstall it. This caused all my issues. Thank you to everyone who tried to help, problem solved.
If anyone comes across this issue, the old version will be located in your nvm folder within your AppData directory.
CodePudding user response:
That's a weird one. I would suggest using Node 16.13.1 LTS instead. LTS means Long Term Support. This means that it is probably more stable than that Node calls the "current" version. Also, since you are using Windows, try the installers available on Node.js' homepage instead of nvm. I've had issues with nvm in the past, though I've never tried it on Windows.