Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.5K
Views
¿Cómo puedo arreglar NPM que siempre dice token inesperado =

Después de que mi máquina se actualizó automáticamente, NPM ya no funciona

 OS: Ubuntu 20.04.3 LTS npm -v: 8.1.4 node -v: v10.19.0

Cada vez que intento iniciar algo con NPM, aparece el mismo mensaje de error:

 *@*:~$ npm help npm WARN npm npm does not support Node.js v10.19.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm You can find the latest version at https://nodejs.org/ npm ERR! Unexpected token = npm ERR! A complete log of this run can be found in: npm ERR! /home/*/.npm/_logs/2021-11-19T13_44_25_087Z-debug.log

El registro de errores contiene lo siguiente:

 0 verbose stack /usr/local/lib/node_modules/npm/lib/commands/help.js:16 30 verbose stack static description = 'Get help on npm' 30 verbose stack ^ 30 verbose stack 30 verbose stack SyntaxError: Unexpected token = 30 verbose stack at Module._compile (internal/modules/cjs/loader.js:723:23) 30 verbose stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) 30 verbose stack at Module.load (internal/modules/cjs/loader.js:653:32) 30 verbose stack at tryModuleLoad (internal/modules/cjs/loader.js:593:12) 30 verbose stack at Function.Module._load (internal/modules/cjs/loader.js:585:3) 30 verbose stack at Module.require (internal/modules/cjs/loader.js:692:17) 30 verbose stack at require (internal/modules/cjs/helpers.js:25:18) 30 verbose stack at Npm.cmd (/usr/local/lib/node_modules/npm/lib/npm.js:97:18) 31 verbose cwd /home/* 32 verbose Linux 5.11.0-40-generic 33 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "help" 34 verbose node v10.19.0 35 verbose npm v8.1.4 36 error Unexpected token = 37 verbose exit 1
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Actualice su versión de nodo, está utilizando la versión npm más reciente y no es compatible con versiones anteriores de nodo

Ya que estás en ubuntu, te recomiendo que uses nvm

sudo apt-get install nvm

 nvm install 16 nvm use 16
over 4 years ago · Santiago Trujillo Report

0

npm está roto porque ignorará PATH e ignorará el tiempo de ejecución de llamada, en su lugar, utilizará un tiempo de ejecución arbitrario.

 sudo which node /usr/local/bin/node

.

 sudo /usr/local/bin/node --version v17.1.0

.

 sudo /usr/local/bin/node /usr/local/bin/npm install -g node@latest ... npm ERR! npm WARN npm npm does not support Node.js v10.19.0 ...

eliminar la versión de distribución podría ser una solución.

over 4 years ago · Santiago Trujillo Report

0

Lo resolví así:

instalar nvm

 sudo apt install curl curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash source ~/.profile nvm install node

Fuente

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!