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

424
Vistas
Syntax Error inside npm.js, also npm keeps trying to use v10.19.0 of nodejs, even after I update it and I don't know why

If this is a stupid question, I am sorry, but my code was literally working fine 2 days ago. Load it up today and I get all this bollocks. I am new to node and npm. So I am sorry if this is all just down to version management.

I am on linux ubuntu. I tested it in a new clean project, same error. Even tried to do something (literally just to check version number) in the terminal with npm, same error. I've done some searches which of some seem credible but I can't even do anything with npm at the moment so I can't even uninstall it or clean cache. Yes, I've tried with sudo.

npm does not support Node.js v10.19.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
/usr/local/lib/node_modules/npm/lib/npm.js:32
  #unloaded = false
  ^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:22:15)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:25)
    at Module._compile (internal/modules/cjs/loader.js:778:30)

I can also run a new install of node but it will say:

nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).

Some what am I meant to do if these versions are incompatible?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Looks like your distro has a very old version of Node in its repository. If you want to upgrade it you'll need to install it through some other mechanism (such as nvm) and then make sure the new version takes precedence on your $PATH or upgrade to a new version of Ubuntu. -Quentin

This comment by Quentin was 100% the answer.

All I had to do was install NVM (Node Version Manager). Update the node package and everything was fine.

You can find NVM here: https://github.com/nvm-sh/nvm#installing-and-updating

about 4 years ago · Juan Pablo Isaza 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