使用 angular-gh-pages 上传到 git 远程 url 不匹配
Uploading to git using angular-gh-pages Remote url mismatch
我已经将我的项目更新为使用 angular 工作区,并希望使用 angular-gh-pages 部署我的演示应用程序。回购是 https://github.com/Gillardo/ngx-bootstrap-datetime-popup
我在 package.json 中创建了一个名为 gh-pages 的命令,它执行命令 ng deploy demo --no-silent
但是当我 运行 它时,我在控制台中收到此错误。项目好像搭建成功了,但是上传到git?
失败了
我正在 运行在 windows 10 台机器上进行此操作。
有人可以帮忙吗?
Uploading via git, please wait...
Cloning https://github.com/Gillardo/ngx-bootstrap-datetime-popup/ into node_modules\gh-pages\.cache\github.com!Gillardo!ngx-bootstrap-datetime-popup
Cleaning
Fetching origin
Checking out origin/gh-pages
❌ An error occurred when trying to deploy:
git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
除了我在 windows 命令行中 运行 SET GIT_TRACE=1
的评论,然后再次 运行 代码,这就是我得到的
我已经这样做了,在删除我的整个存储库后,运行ning npm install
安装我的 node_modules 然后 运行ning npm run gh-pages
我将设置设置为命令,然后 运行s 这个,就像我的 package.json "gh-pages": "ng deploy demo --no-silent"
不确定这是否有任何区别,但在我的 angular.json 文件中,我设置了这个
编辑:
这是失败时图片中的文字
�� Uploading via git, please wait...
Cloning https://github.com/Gillardo/ngx-bootstrap-datetime-popup.git into node_modules\gh-pages\.cache\github.com!Gillardo!ngx-bootstrap-datetime-popup.git
❌ An error occurred when trying to deploy:
Remote url mismatch. Got "12:21:47.470038 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin" but expected "https://github.com/Gillardo/ngx-bootstrap-datetime-popup.git" in node_modules\gh-pages\.
cache\github.com!Gillardo!ngx-bootstrap-datetime-popup.git. Try running the `gh-pages-clean` script first.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Darren\AppData\Roaming\npm-cache\_logs20-05-03T11_21_47_564Z-debug.log
这是日志包中的有用内容
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gh-pages' ]
2 info using npm@6.4.0
3 info using node@v10.15.3
4 verbose run-script [ 'pregh-pages', 'gh-pages', 'postgh-pages' ]
5 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~pregh-pages: ngx-bootstrap-datetime-popup@5.1.0
6 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: ngx-bootstrap-datetime-popup@5.1.0
7 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: unsafe-perm in lifecycle true
8 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: PATH: C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;C:\Users\Darren\AppData\Local\GitHubDesktop\bin;C:\Users\Darren\.dotnet\tools;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;;C:\Users\Darren\AppData\Local\Programs\Fiddler;C:\Users\Darren\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
9 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: CWD: D:\Github\ngx-bootstrap-datetime-popup
10 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Args: [ '/d /s /c', 'ng deploy demo --no-silent' ]
11 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Returned: code: 1 signal: null
12 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Failed to exec gh-pages script
13 verbose stack Error: ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ngx-bootstrap-datetime-popup@5.1.0
15 verbose cwd D:\Github\ngx-bootstrap-datetime-popup
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "gh-pages"
18 verbose node v10.15.3
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
22 error Exit status 1
23 error Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
如果我 运行 `SET "GIT_TRACE=" 在 运行 命令之前我得到这个
Checking out origin/gh-pages
❌ An error occurred when trying to deploy:
error: cannot spawn sh: No such file or directory
fatal: unable to fork
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
npm ERR! Exit status 1
日志是这样写的
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gh-pages' ]
2 info using npm@6.4.0
3 info using node@v10.15.3
4 verbose run-script [ 'pregh-pages', 'gh-pages', 'postgh-pages' ]
5 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~pregh-pages: ngx-bootstrap-datetime-popup@5.1.0
6 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: ngx-bootstrap-datetime-popup@5.1.0
7 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: unsafe-perm in lifecycle true
8 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: PATH: C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;C:\Users\Darren\AppData\Local\GitHubDesktop\bin;C:\Users\Darren\.dotnet\tools;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;;C:\Users\Darren\AppData\Local\Programs\Fiddler;C:\Users\Darren\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
9 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: CWD: D:\Github\ngx-bootstrap-datetime-popup
10 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Args: [ '/d /s /c', 'ng deploy demo --no-silent' ]
11 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Returned: code: 1 signal: null
12 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Failed to exec gh-pages script
13 verbose stack Error: ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ngx-bootstrap-datetime-popup@5.1.0
15 verbose cwd D:\Github\ngx-bootstrap-datetime-popup
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "gh-pages"
18 verbose node v10.15.3
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
22 error Exit status 1
23 error Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Git版本
检查您的 git
版本是否遵循 Prerequisites
Git 1.9 or higher (execute git --version
to check your version)
Git for Windows 未正确安装
根据显示此错误的编辑:
❌ An error occurred when trying to deploy:
error: cannot spawn sh: No such file or directory
fatal: unable to fork
请参阅 and cannot spawn sh on Windows 了解解决方案。
我已经将我的项目更新为使用 angular 工作区,并希望使用 angular-gh-pages 部署我的演示应用程序。回购是 https://github.com/Gillardo/ngx-bootstrap-datetime-popup
我在 package.json 中创建了一个名为 gh-pages 的命令,它执行命令 ng deploy demo --no-silent
但是当我 运行 它时,我在控制台中收到此错误。项目好像搭建成功了,但是上传到git?
我正在 运行在 windows 10 台机器上进行此操作。
有人可以帮忙吗?
Uploading via git, please wait...
Cloning https://github.com/Gillardo/ngx-bootstrap-datetime-popup/ into node_modules\gh-pages\.cache\github.com!Gillardo!ngx-bootstrap-datetime-popup
Cleaning
Fetching origin
Checking out origin/gh-pages
❌ An error occurred when trying to deploy:
git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
除了我在 windows 命令行中 运行 SET GIT_TRACE=1
的评论,然后再次 运行 代码,这就是我得到的
我已经这样做了,在删除我的整个存储库后,运行ning npm install
安装我的 node_modules 然后 运行ning npm run gh-pages
我将设置设置为命令,然后 运行s 这个,就像我的 package.json "gh-pages": "ng deploy demo --no-silent"
不确定这是否有任何区别,但在我的 angular.json 文件中,我设置了这个
编辑: 这是失败时图片中的文字
�� Uploading via git, please wait...
Cloning https://github.com/Gillardo/ngx-bootstrap-datetime-popup.git into node_modules\gh-pages\.cache\github.com!Gillardo!ngx-bootstrap-datetime-popup.git
❌ An error occurred when trying to deploy:
Remote url mismatch. Got "12:21:47.470038 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin" but expected "https://github.com/Gillardo/ngx-bootstrap-datetime-popup.git" in node_modules\gh-pages\.
cache\github.com!Gillardo!ngx-bootstrap-datetime-popup.git. Try running the `gh-pages-clean` script first.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Darren\AppData\Roaming\npm-cache\_logs20-05-03T11_21_47_564Z-debug.log
这是日志包中的有用内容
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gh-pages' ]
2 info using npm@6.4.0
3 info using node@v10.15.3
4 verbose run-script [ 'pregh-pages', 'gh-pages', 'postgh-pages' ]
5 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~pregh-pages: ngx-bootstrap-datetime-popup@5.1.0
6 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: ngx-bootstrap-datetime-popup@5.1.0
7 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: unsafe-perm in lifecycle true
8 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: PATH: C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;C:\Users\Darren\AppData\Local\GitHubDesktop\bin;C:\Users\Darren\.dotnet\tools;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;;C:\Users\Darren\AppData\Local\Programs\Fiddler;C:\Users\Darren\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
9 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: CWD: D:\Github\ngx-bootstrap-datetime-popup
10 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Args: [ '/d /s /c', 'ng deploy demo --no-silent' ]
11 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Returned: code: 1 signal: null
12 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Failed to exec gh-pages script
13 verbose stack Error: ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ngx-bootstrap-datetime-popup@5.1.0
15 verbose cwd D:\Github\ngx-bootstrap-datetime-popup
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "gh-pages"
18 verbose node v10.15.3
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
22 error Exit status 1
23 error Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
如果我 运行 `SET "GIT_TRACE=" 在 运行 命令之前我得到这个
Checking out origin/gh-pages
❌ An error occurred when trying to deploy:
error: cannot spawn sh: No such file or directory
fatal: unable to fork
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
npm ERR! Exit status 1
日志是这样写的
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gh-pages' ]
2 info using npm@6.4.0
3 info using node@v10.15.3
4 verbose run-script [ 'pregh-pages', 'gh-pages', 'postgh-pages' ]
5 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~pregh-pages: ngx-bootstrap-datetime-popup@5.1.0
6 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: ngx-bootstrap-datetime-popup@5.1.0
7 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: unsafe-perm in lifecycle true
8 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: PATH: C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;D:\Github\ngx-bootstrap-datetime-popup\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\Tools\Binn\ManagementStudio\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\dotnet\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;C:\Users\Darren\AppData\Local\GitHubDesktop\bin;C:\Users\Darren\.dotnet\tools;C:\Users\Darren\AppData\Local\Microsoft\WindowsApps;;C:\Users\Darren\AppData\Local\Programs\Fiddler;C:\Users\Darren\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
9 verbose lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: CWD: D:\Github\ngx-bootstrap-datetime-popup
10 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Args: [ '/d /s /c', 'ng deploy demo --no-silent' ]
11 silly lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Returned: code: 1 signal: null
12 info lifecycle ngx-bootstrap-datetime-popup@5.1.0~gh-pages: Failed to exec gh-pages script
13 verbose stack Error: ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid ngx-bootstrap-datetime-popup@5.1.0
15 verbose cwd D:\Github\ngx-bootstrap-datetime-popup
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Darren\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "gh-pages"
18 verbose node v10.15.3
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error ngx-bootstrap-datetime-popup@5.1.0 gh-pages: `ng deploy demo --no-silent`
22 error Exit status 1
23 error Failed at the ngx-bootstrap-datetime-popup@5.1.0 gh-pages script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Git版本
检查您的 git
版本是否遵循 Prerequisites
Git 1.9 or higher (execute
git --version
to check your version)
Git for Windows 未正确安装
根据显示此错误的编辑:
❌ An error occurred when trying to deploy:
error: cannot spawn sh: No such file or directory
fatal: unable to fork
请参阅