对于 npm install from folder,尽管已经安装了依赖项(共享主机),但维基媒体包出现 git 错误

for npm install from folder gives git error for wikimedia packages despite dependencies already being installed (shared hosting)

维基媒体包(parsoid、restbase、加上服务运行器和限制)上的 Npm 安装失败并出现 git 错误,尽管已经提前复制了源文件,并且 运行

npm install <folder> 要么 npm install 来自实际文件夹,其中有一个 package.json 或者

npm install -g --only=prod --verbose limitation

给出错误的依赖项有时是直接依赖项,有时是依赖项的依赖项。

设置 - linux / CentrOS 6

尝试的步骤 - 仅安装生产依赖项

正在查找的依赖项包括

示例错误日志:限制包 (3 个依赖项,包括 bluebird、kad、readable-stream)

135 http fetch GET 200 http://registry.npmjs.org/readable-stream 17ms (from cache) 136 silly pacote range manifest for readable-stream@^2.0.5 fetched in 25ms 137 silly resolveWithNewModule readable-stream@2.3.6 checking installable status 138 silly fetchPackageMetaData error for kad@git+https://github.com/wikimedia/kad.git#master Error while executing: 138 silly fetchPackageMetaData /usr/local/cpanel/3rdparty/lib/path-bin/git ls-remote -h -t https://github.com/wikimedia/kad.git 138 silly fetchPackageMetaData 138 silly fetchPackageMetaData fatal: Unable to find remote helper for 'https' 138 silly fetchPackageMetaData 138 silly fetchPackageMetaData exited with error code: 128 139 timing stage:rollbackFailedOptional Completed in 1ms 140 timing stage:runTopLevelLifecycles Completed in 4749ms 141 verbose stack Error: exited with error code: 128 141 verbose stack at ChildProcess.<anonymous> (/home/mousey/.nvm/.nvm/versions/node/v11.12.0/lib/node_modules/npm/node_modules/pacote/lib/util/finished.js:12:19) 141 verbose stack at ChildProcess.emit (events.js:197:13) 141 verbose stack at maybeClose (internal/child_process.js:988:16) 141 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) 142 verbose cwd /home/mousey/.nvm/.nvm/versions/node/v11.12.0/lib/node_modules 143 verbose Linux 2.6.32-896.16.1.lve1.4.54.el6.x86_64 144 verbose argv "/home/mousey/.nvm/.nvm/versions/node/v11.12.0/bin/node" "/home/mousey/.nvm/.nvm/versions/node/v11.12.0/bin/npm" "install" "-g" "--save" "--verbose" "--only=prod" "service-runner" 145 verbose node v11.12.0 146 verbose npm v6.9.0 147 error Error while executing: 147 error /usr/local/cpanel/3rdparty/lib/path-bin/git ls-remote -h -t https://github.com/wikimedia/kad.git 147 error 147 error fatal: Unable to find remote helper for 'https' 147 error 147 error exited with error code: 128 148 verbose exit [ 1, true ]

尝试将其添加到您的 .gitconfig 文件中。 git+http/ssh 遥控器在 npm 中存在一个已知问题。

  [url "https://github.com/"]
     insteadOf = git@github.com:
     insteadOf = git://github.com/
     insteadOf = git+https://github.com/
     insteadOf = git+ssh://git@github.com:
     insteadOf = ssh://git@github.com:
     insteadOf = ssh+https://git@github.com/

Link for reference

Git路径设置错误,导致git错误:

Unable to find remote helper for 'https'

.

git --exec-path 揭示了 git 问题

我仍然不明白为什么在所有文件都是本地文件并且已经安装了从 git 中提取的软件包时还需要 git。