Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

532
Visualizações
npm gives a TypeError every time I run it

I am trying to install a package using npm but no matter what I type in the console it just gives me errors.

I have version 16.6.2 of Node.js installed through the executable file from the website. I have tried reinstalling and repairing using the executable but it hasn't changed anything. I have also restarted my computer after reinstalling. It doesn't matter if I include any arguments after npm. Just typing npm and hitting enter will send these errors.

Node still runs just fine and will run the code I tell it to. It just seems to be npm that is broken.

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Program Files\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:94:18)
    at Object.<anonymous> (C:\Program Files\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:94:18)
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (C:\Program Files\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:94:18)
    at Object.<anonymous> (C:\Program Files\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:94:18)
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\make-fetch-happen\lib\agent.js:161:25)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I have it figured out. Something must have gotten corrupted during the installation. I downloaded a new installation executable. I removed nodejs and then I deleted the folder from my program files and reinstalled. That fixed it. I should have tried this earlier but I didn't think about how there still might be files behind.

If you have this problem, uninstall using the installation file then go to your program files and delete the nodejs folder and then reinstall.

over 4 years ago · Santiago Trujillo Relatório

0

I had the same problem. Check if all old files in the nodejs folder after 'uninstall' are deleted!! This must work!

over 4 years ago · Santiago Trujillo Relatório

0

I just installed the last LTS version of Node.JS (16.13.1, npm 8.1.2) and got the same problem. And I figured out too in my own way by running this in cmd:

CD /D "C:\Program Files\nodejs\node_modules\npm\node_modules"
RMDIR /S /Q "%CD%\socks-proxy-agent\dist\"
npm --global --force install socks-proxy-agent@6.1.1
node --trace-deprecation socks-proxy-agent

After this, got some deprecation warnings, but npm starts works.

To view more info about warnings, run this:

CD /D "C:\Program Files\nodejs\node_modules\npm\node_modules"
node --trace-deprecation socks-proxy-agent
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda