Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

533
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda