Npm install on wikimedia packages (parsoid, restbase, plus service-runner and limitation) fails with a git error, despite having copied the source files in advance, and running

npm install <folder> or npm install from the actual folder, which has a package.json or

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

The dependencies giving errors are sometimes direct dependencies, sometimes dependencies of dependencies.

Setup - linux / CentrOS 6

  • git installed by ISP on shared host, git re-install fails

  • no admin rights since shared hosting

  • node 11.12.0, npm 6.9.0

  • only wikimedia packages fail, but not all wikimedia packages

Steps tried - installing only production dependencies

  • npm cache verify plus deleting relevant node_module and .npm folders before install

  • editing package.json to replace git link for dependencies with just the versions, eg for kad 2.5.1

  • latest version of npm and node

  • reinstall of node/nvm/npm

  • also failed with node v11.11.0

  • using npm list to check any dependency issues and fix in advance

  • git fix by swapping to http or git protocols failed with same error

Dependencies being looked for include

  • pegjs

  • kad

  • content-type

Example error log: limitation package (3 dependencies, including 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 [email protected] 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 ]

2

There are 2 best solutions below

0
On BEST ANSWER

Git path was set incorrectly, causing the git error:

Unable to find remote helper for 'https'

solution.

git --exec-path revealed the git problem

I still don't understand why git was needed when all files wre local and packages pulled from git were already installed.

1
On

Try adding this to your .gitconfig file. There is a known issue in npm with git+http/ssh remotes.

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

Link for reference