davigeh
(usa Ubuntu)
Enviado em 27/12/2023 - 15:51h
Olá, sou novo no linux, e recentemente comecei a usar o POP-OS, estou com erro para rodar o node(versão v20.10.0) e npm. Já tentei desinstalar e instalar o node e o npm várias vezes, atualizar etc, mas continua com o mesmo erro. Quando tento fazer um node aula05.js da o seguinte erro:
davi@pop-os:~/Documentos/htdocs/curso-typescript/build$ node aula05.js /home/davi/Documentos/htdocs/curso-typescript/build/aula05.js:10 valores.push(555); ^
ReferenceError: valores is not defined at Object. (/home/davi/Documentos/htdocs/curso-typescript/build/aula05.js:10:1) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Module.load (node:internal/modules/cjs/loader:1207:32) at Module._load (node:internal/modules/cjs/loader:1023:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) at node:internal/main/run_main_module:28:49
Node.js v20.10.0
----------------------------------------------------------------------------------
Ao dar um npm -v, aparece o seguinte erro:
ERROR: npm v10.2.3 is known not to run on Node.js v12.22.9. This version of npm supports the following node versions: ^18.17.0 || >=20.5.0. You can find the latest version at
https://nodejs.org/.
ERROR: /home/davi/node/lib/node_modules/npm/lib/utils/exit-handler.js:19 const hasLoadedNpm = npm?.config.loaded ^
SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at module.exports (/home/davi/node/lib/node_modules/npm/lib/cli-entry.js:15:23) at module.exports (/home/davi/node/lib/node_modules/npm/lib/es6/validate-engines.js:39:10) at module.exports (/home/davi/node/lib/node_modules/npm/lib/cli.js:4:31)