Получение ошибки «Ошибка: spawn git ENOENT» при развертывании приложения React JS на страницах Github - PullRequest
2 голосов
/ 08 апреля 2020

При развертывании моего приложения React JS на Github.io у меня появляется ошибка ниже.

Я выполнил следующие шаги для развертывания моего приложения React.

Добавлено в пакет. json файл, "домашняя страница": " https: // [имя пользователя] .github.io / [appname] ",

Добавлено в сценарии:

"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build"

Ран npm запустить развертывание

Выдает приведенную ниже ошибку. Журнал ошибок прилагается ниже.

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'deploy' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle my-app@0.1.0~predeploy: my-app@0.1.0
6 verbose lifecycle my-app@0.1.0~predeploy: unsafe-perm in lifecycle true
7 verbose lifecycle my-app@0.1.0~predeploy: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\React Projects\my-app\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Android\android-sdk\tools\bin;;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Java\jdk1.8.0_111/bin;E:\Development\Apache Tomcat\apache-tomcat-8.0.21/bin;E:\Development\Apache Maven\apache-maven-3.2.3/bin;C:\Program Files\Microsoft VS Code\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\Maddy\AppData\Roaming\npm
8 verbose lifecycle my-app@0.1.0~predeploy: CWD: E:\React Projects\my-app
9 silly lifecycle my-app@0.1.0~predeploy: Args: [ '/d /s /c', 'npm run build' ]
10 silly lifecycle my-app@0.1.0~predeploy: Returned: code: 0  signal: null
11 info lifecycle my-app@0.1.0~deploy: my-app@0.1.0
12 verbose lifecycle my-app@0.1.0~deploy: unsafe-perm in lifecycle true
13 verbose lifecycle my-app@0.1.0~deploy: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\React Projects\my-app\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Android\android-sdk\tools;C:\Android\android-sdk\platform-tools;C:\Android\android-sdk\tools\bin;;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Java\jdk1.8.0_111/bin;E:\Development\Apache Tomcat\apache-tomcat-8.0.21/bin;E:\Development\Apache Maven\apache-maven-3.2.3/bin;C:\Program Files\Microsoft VS Code\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\Maddy\AppData\Roaming\npm
14 verbose lifecycle my-app@0.1.0~deploy: CWD: E:\React Projects\my-app
15 silly lifecycle my-app@0.1.0~deploy: Args: [ '/d /s /c', 'gh-pages -b master -d build' ]
16 silly lifecycle my-app@0.1.0~deploy: Returned: code: 1  signal: null
17 info lifecycle my-app@0.1.0~deploy: Failed to exec deploy script
18 verbose stack Error: my-app@0.1.0 deploy: `gh-pages -b master -d build`
18 verbose stack Exit status 1
18 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
18 verbose stack     at EventEmitter.emit (events.js:198:13)
18 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
18 verbose stack     at ChildProcess.emit (events.js:198:13)
18 verbose stack     at maybeClose (internal/child_process.js:982:16)
18 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
19 verbose pkgid my-app@0.1.0
20 verbose cwd E:\React Projects\my-app
21 verbose Windows_NT 6.1.7601
22 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy"
23 verbose node v10.16.0
24 verbose npm  v6.9.0
25 error code ELIFECYCLE
26 error errno 1
27 error my-app@0.1.0 deploy: `gh-pages -b master -d build`
27 error Exit status 1
28 error Failed at the my-app@0.1.0 deploy script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]```

...