2

cannot use npm any command, but the node -v is worked
error message:

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\agent.js:114:44)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (E:\nodejs\node_modules\npm\node_modules\socks-proxy-agent\dist\index.js:5:33)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (E:\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
Could not determine Node.js install directory

os: windows 11
node: v16.13.2

I also reinstall the node and restart the system, but still did not work

Deng
  • 138
  • 1
  • 3
  • 12
  • https://github.com/TooTallNate/node-socks-proxy-agent/issues/76 – raina77ow Feb 05 '22 at 13:11
  • I have already deleted the node_modules in `C:\users\xxx\AppData\Roaming\npm` , but did not work. – Deng Feb 05 '22 at 13:19
  • Can you share project structure with package.json @Deng? – ARIF MAHMUD RANA Feb 05 '22 at 13:32
  • @ARIF MAHMUD RANA actually, there is no project, when I using `npm install -g @vue/cli `, this problem appeared, then I try to the other npm command, all BOOM! Maybe my latest project broke the npm modules, I don't know what to do except reinstall node and reboot system. – Deng Feb 05 '22 at 13:38

1 Answers1

0

I just had a similar issue.

I managed to use npm after installing NodeJs using Windows Powershell, based on this GitHub discussion...

https://github.com/coreybutler/nvm-windows/issues/527