nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.45k stars 278 forks source link

Error running 'ntl init' (Netlify CLI): Node.js not found #4212

Closed elitostajunior closed 1 year ago

elitostajunior commented 1 year ago

Details

I'm trying to deploy a React project that I made using Vite and it always gives an error when opening Netlify CLI. I've already updated Node and Npm; I checked the PATH of the system environment, everything is OK; but the problem still persists.

C:\Users\{user}\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

I am concerned as I have done everything I can to resolve this issue. Anyone who can help me, I'll be grateful.

Node.js version

{
  node: '18.17.0',
  acorn: '8.8.2',
  ada: '2.5.0',
  ares: '1.19.1',
  brotli: '1.0.9',
  cldr: '43.0',
  icu: '73.1',
  llhttp: '6.0.11',
  modules: '108',
  napi: '9',
  nghttp2: '1.52.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.9+quic',
  simdutf: '3.2.12',
  tz: '2023c',
  undici: '5.22.1',
  unicode: '15.0',
  uv: '1.44.2',
  uvwasi: '0.0.18',
  v8: '10.2.154.26-node.26',
  zlib: '1.2.13.1-motley'
}

Example code

$ ntl init
C:\Users\{user}\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

Operating system

(informations in Portuguese language)

Edição: Windows 10 Pro Versão: 21H1 Instalado em ‎01/‎01/‎2021 Compilação do SO: 19043.1526 Experiência: Windows Feature Experience Pack 120.2212.4170.0

Scope

Captura de tela 2023-07-25 212821 image image

Module and version

Not applicable.

preveen-stack commented 1 year ago

https://github.com/nodejs/node/issues/29287#issuecomment-1366467141 Please check the above comment

elitostajunior commented 1 year ago

nodejs/node#29287 (comment) Please check the above comment

I had already managed to solve this problem by adding "npx" before the command, but I did the suggested solution and managed to run the command without the need to use "npx". Thank you very much!