I have provider/gcp directroy containing its own package.json in my nodejs application.
In my root package.json, I have a script like this:
"installGCP": "npm i provier/gcp".
I want to install provider/gcp dependencies into root node_modules folder only.
On my local, its working fine. But through build pipeline, its failing with error code 128.
verbose stack Error: An unknown git error occurred
1173 verbose stack at makeError (/usr/lib/node_modules/npm/node_modules/#npmcli/git/lib/make-error.js:28:13)
1173 verbose stack at /usr/lib/node_modules/npm/node_modules/#npmcli/git/lib/spawn.js:36:26
1173 verbose stack at runMicrotasks (<anonymous>)
1173 verbose stack at processTicksAndRejections (node:internal/process/task_queues:96:5)
1174 verbose cwd /var/vsts/2/s
1175 verbose Linux 4.19.167+
1176 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "provider/gcp"
1177 verbose node v16.13.0
1178 verbose npm v8.1.0
1179 error code 128
1180 error An unknown git error occurred
1181 error command git --no-replace-objects ls-remote ssh://git#github.com/provider/gcp.git
1182 error Warning: Permanently added the ECDSA host key for IP address '140.82.112.3' to the list of known hosts.
1182 error git#github.com: Permission denied (publickey).
1182 error fatal: Could not read from remote repository.
1182 error
1182 error Please make sure you have the correct access rights
1182 error and the repository exists.
1183 verbose exit 128
I have already tried this option based on recommendation on some other forums, but it did not work either.
"installGCP": "git config --global url.'https://'.insteadOf git:// && npm i provider/gcp"
Related
I'm trying to install the package #truffle/hdwallet-provider .
As written in the doc, I'm running:
npm i #truffle/hdwallet-provider
Here is the error message I'm getting:
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git#github.com/ethereumjs/ethereumjs-abi.git
npm ERR! git#github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-03-08T14_13_15_122Z-debug-0.log
Here are the logs:
698 verbose Linux 5.13.0-30-generic
699 verbose argv "/usr/bin/node" "/usr/bin/npm" "i" "#truffle/hdwallet-provider"
700 verbose node v14.17.6
701 verbose npm v8.5.3
702 error code 128
703 error An unknown git error occurred
704 error command git --no-replace-objects ls-remote ssh://git#github.com/ethereumjs/ethereumjs-abi.git
705 error git#github.com: Permission denied (publickey).
705 error fatal: Could not read from remote repository.
705 error
705 error Please make sure you have the correct access rights
705 error and the repository exists.
706 verbose exit 128
707 timing npm Completed in 6266ms
708 verbose unfinished npm timer reify 1646748520075
709 verbose unfinished npm timer reify:loadTrees 1646748520084
710 verbose code 128
711 error A complete log of this run can be found in:
711 error /root/.npm/_logs/2022-03-08T14_08_39_958Z-debug-0.log
My node version:
v14.17.6
My NPM version:
v8.5.3
Actually, it's a well-known bug.
https://github.com/trufflesuite/truffle/issues/2852
Using this solved the problem:
npm i #truffle/hdwallet-provider#next
For other people coming here for the same bug with another package, check this SO post:
npm install error code 128
Try npm config set legacy-peer-deps true, that worked for me.
can't get over this error for a day, can't find viable solution online, please help me see what I don't see. I have two laptops next to each other, one installed nodejs and cypress flawlessly, one is throwing this kind of error. Tried reinstalling, uninstalling, changing PATH variable, different versions of nodejs, turning off and on, restarting, and looking for solution online for hours. I don't want to download Cypress directly, I want to do it the "correct way". Relevant lines from log:
1116 info run cypress#7.2.0 postinstall node_modules/cypress node index.js --exec install
1117 info run cypress#7.2.0 postinstall { code: 'ENOENT', signal: undefined }
1118 timing reify:rollback:createSparse Completed in 779ms
1119 timing reify:rollback:retireShallow Completed in 0ms
1120 timing command:install Completed in 5328ms
1121 verbose stack Error: spawn C:\Program ENOENT
1121 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
1121 verbose stack at onErrorNT (internal/child_process.js:465:16)
1121 verbose stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
1122 verbose pkgid cypress#7.2.0
1123 verbose cwd C:\Users\sopkop\cypress_project
1124 verbose Windows_NT 10.0.19042
1125 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sopkop\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "cypress"
1126 verbose node v14.16.1
1127 verbose npm v7.11.2
1128 error code ENOENT
1129 error syscall spawn C:\Program
1130 error path C:\Users\sopkop\cypress_project\node_modules\cypress
1131 error errno -4058
1132 error enoent spawn C:\Program ENOENT
1133 error enoent This is related to npm not being able to find a file.
1134 verbose exit -4058
This
spawn C:\Program ENOENT
Looks like you have an unquoted path in the post install. That is probably supposed to "C:\Program Files..." or "C:\Program Files (x86)...". Instead it is trying to execute the C:\Program which fails with ENOENT because it doesn't exist. Check your environment settings and the scripts you are calling.
problem was with user configuration in .npmrc file. contents of the file:
script-shell=C:\Program
Files\git\bin\bash.exe=
registry=http://registry.npmjs.org/
strict-ssl=false
proxy=null
https-proxy=null
not sure where did the "script-shell=C:\Program" come from, but deleting .npmrc file fixed the issue.
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 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 ]
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.
Try adding this to your .gitconfig file. There is a known issue in npm with git+http/ssh remotes.
[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
I would like to try and setup Reaction Commerce this reaction-doc. When I run reaction init, NPM error occurs in installing NPM packages.
5868 verbose stack Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\..\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git#github.com:ongoworks/node-authorize-net.git C:\Users\..\AppData\Roaming\npm-cache\_git-remotes\git-github-com-ongoworks-node-authorize-net-git-e88b3c4b
5868 verbose stack Cloning into bare repository 'C:\Users\...\AppData\Roaming\npm-cache\_git-remotes\git-github-com-ongoworks-node-authorize-net-git-e88b3c4b'...
5868 verbose stack Host key verification failed.
5868 verbose stack fatal: Could not read from remote repository.
5868 verbose stack
5868 verbose stack Please make sure you have the correct access rights
5868 verbose stack and the repository exists.
5868 verbose stack
5868 verbose stack at ChildProcess.exithandler (child_process.js:213:12)
5868 verbose stack at emitTwo (events.js:87:13)
5868 verbose stack at ChildProcess.emit (events.js:172:7)
5868 verbose stack at maybeClose (internal/child_process.js:829:16)
5868 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
5869 verbose cwd C:\Users\...\reaction
5870 error Windows_NT 6.1.7600
5871 error argv "C:\\Users\\...\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.4.1_1\\mt-os.windows.x86_32\\dev_bundle\\bin\\node.exe" "C:\\Users\\...\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.4.1_1\\mt-os.windows.x86_32\\dev_bundle\\lib\\node_modules\\npm\\bin\\npm-cli.js" "install"
5872 error node v4.5.0
5873 error npm v3.10.6
5874 error code 128
5875 error Command failed: git -c core.longpaths=true clone --template=C:\Users\...\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git#github.com:ongoworks/node-authorize-net.git C:\Users\...\AppData\Roaming\npm-cache\_git-remotes\git-github-com-ongoworks-node-authorize-net-git-e88b3c4b
5875 error Cloning into bare repository 'C:\Users\...\AppData\Roaming\npm-cache\_git-remotes\git-github-com-ongoworks-node-authorize-net-git-e88b3c4b'...
5875 error Host key verification failed.
5875 error fatal: Could not read from remote repository.
5875 error
5875 error Please make sure you have the correct access rights
5875 error and the repository exists.
5876 error If you need help, you may report this error at:
5876 error <https://github.com/npm/npm/issues>
5877 verbose exit [ 1, true ]
I found Host key verification failed and Please make sure you have the correct access rights. I already created ssh key in my github account. I can login successfully from Git Bash command(ssh -T git#github.com).
Do I need special access key for reaction commerce? I am confused this problem is git bash configuration problem or key verification problem in Reaction. Cos I have no experience in bit bash command.
I'm just starting out working with node.js and when I try npm install I get an error stating Failed at the bcrypt#0.8.5 install script 'node-gyp rebuild'. After extensive googling I still have not found the problem.
Here's the error log:
Error Log
313 verbose stack Error: bcrypt#0.8.5 install: `node-gyp rebuild`
313 verbose stack Exit status 1
313 verbose stack at EventEmitter.<anonymous> (C:\Users\Apparaat1\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:239:16)
313 verbose stack at emitTwo (events.js:100:13)
313 verbose stack at EventEmitter.emit (events.js:185:7)
313 verbose stack at ChildProcess.<anonymous> (C:\Users\Apparaat1\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
313 verbose stack at emitTwo (events.js:100:13)
313 verbose stack at ChildProcess.emit (events.js:185:7)
313 verbose stack at maybeClose (internal/child_process.js:827:16)
313 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
314 verbose pkgid bcrypt#0.8.5
315 verbose cwd D:\Werk\W12C\we12c\W12C
316 error Windows_NT 6.1.7601
317 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Apparaat1\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
318 error node v5.7.0
319 error npm v3.7.3
320 error code ELIFECYCLE
321 error bcrypt#0.8.5 install: `node-gyp rebuild`
321 error Exit status 1
322 error Failed at the bcrypt#0.8.5 install script 'node-gyp rebuild'.
322 error Make sure you have the latest version of node.js and npm installed.
322 error If you do, this is most likely a problem with the bcrypt package,
322 error not with npm itself.
322 error Tell the author that this fails on your system:
322 error node-gyp rebuild
322 error You can get information on how to open an issue for this project with:
322 error npm bugs bcrypt
322 error Or if that isn't available, you can get their info via:
322 error npm owner ls bcrypt
322 error There is likely additional logging output above.
323 verbose exit [ 1, true ]
Versions:
node -v
v5.7.0
npm -v
3.7.3
May be it's a little bit late but the solution in node-gyp
https://github.com/nodejs/node-gyp#installation
There are 2
different options.
Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2: Install tools and configuration manually:
Visual C++ Build Environment:
Option 1: Install Visual C++ Build Tools using the Default Install option.
Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.
Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)
Launch cmd, npm config set msvs_version 2015
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
[Windows Vista / 7 only] requires .NET Framework 4.5.1