Ошибка входа в Firebase: создать cmd ENOENT в NodeJS - PullRequest
0 голосов
/ 10 июля 2020

Я пытаюсь настроить приложение Firebase TypeScript в другой системе. Когда я выполняю firebase login, возникает следующее исключение:

[debug] [2020-07-10T12:35:28.031Z] ----------------------------------------------------------------------
[debug] [2020-07-10T12:35:28.034Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\gp\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js login
[debug] [2020-07-10T12:35:28.034Z] CLI Version:   8.5.0
[debug] [2020-07-10T12:35:28.034Z] Platform:      win32
[debug] [2020-07-10T12:35:28.035Z] Node Version:  v12.18.2
[debug] [2020-07-10T12:35:28.036Z] Time:          Fri Jul 10 2020 18:05:28 GMT+0530 (India Standard Time)
[debug] [2020-07-10T12:35:28.036Z] ----------------------------------------------------------------------
[debug] [2020-07-10T12:35:28.037Z] 
[info] i  Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.
 
[info] i  To change your data collection preference at any time, run `firebase logout` and log in again. 
[info] 
[info] Visit this URL on this device to log in:
[info] https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=3839&redirect_uri=http%3A%2F%2Flocalhost%3A
[info] 
    [info] Waiting for authentication...
    [debug] [2020-07-10T12:57:25.170Z] Error: spawn cmd ENOENT
        at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
        at onErrorNT (internal/child_process.js:469:16)
        at processTicksAndRejections (internal/process/task_queues.js:84:21)
    [error] 
    [error] Error: An unexpected error has occurred.

В новой системе я использую следующее программное обеспечение:

  • node v12.18.2
  • npm v6.14.5

В старой системе я использовал следующее программное обеспечение:

  • node v10.16.3
  • npm v6.12.0

Я также пробовал следующее:

  • выполнение npm install -g firebase-tools@latest
  • выполнение всех шагов в отдельном cmd, запущенном от имени администратора .

В моем старом рабочем пространстве все работало отлично.

1 Ответ

1 голос
/ 10 июля 2020

Проблема устранена путем добавления 'C: \ Windows \ System32' в мою переменную среды.

...