npm WARN addRemoteGit Error: Command failed

npm install error

npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit  amcharts/ammap3 resetting remote C:\Users\holdlg\AppData\Roaming\npm-cache\_git-remotes\git-github-com-amcharts-ammap3-git-5b4c9c11 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit  amcharts/amcharts3 resetting remote C:\Users\holdlg\AppData\Roaming\npm-cache\_git-remotes\git-github-com-amcharts-amcharts3-git-867ad69c because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }

解决方法

是因为npm缓存目录去缓存了个 _git-remotes 目录
windows路径:C:\Users\youname\AppData\Roaming\npm-cache
删除_git-remotes 再继续npm install。

如果总是中断,可以尝试设置代理试试。
(自备的Shadownsock代理地址http://127.0.0.1:1080)
git config –global http.proxy http://127.0.0.1:1080
git config –global https.proxy https://127.0.0.1:1080
git config –global http.proxy ‘socks5://127.0.0.1:1080’
git config –global https.proxy ‘socks5://127.0.0.1:1080’
取消代理
git config –global –unset http.proxy
git config –global –unset https.proxy

C:\Users\Administrator>npm install opencv4nodejs npm WARN cleanup Failed to remove some directories [ npm WARN cleanup [ npm WARN cleanup 'C:\\Users\\Administrator\\node_modules\\opencv-build', npm WARN cleanup [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Administrator\node_modules\opencv-build'] { npm WARN cleanup errno: -4082, npm WARN cleanup code: 'EBUSY', npm WARN cleanup syscall: 'rmdir', npm WARN cleanup path: 'C:\\Users\\Administrator\\node_modules\\opencv-build' npm WARN cleanup } npm WARN cleanup ], npm WARN cleanup [ npm WARN cleanup 'C:\\Users\\Administrator\\node_modules', npm WARN cleanup [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Administrator\node_modules\opencv-build'] { npm WARN cleanup errno: -4082, npm WARN cleanup code: 'EBUSY', npm WARN cleanup syscall: 'rmdir', npm WARN cleanup path: 'C:\\Users\\Administrator\\node_modules\\opencv-build' npm WARN cleanup } npm WARN cleanup ], npm WARN cleanup [ npm WARN cleanup 'C:\\Users\\Administrator\\node_modules\\readable-stream', npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\Administrator\node_modules\readable-stream'] { npm WARN cleanup errno: -4048, npm WARN cleanup code: 'EPERM', npm WARN cleanup syscall: 'rmdir', npm WARN cleanup path: 'C:\\Users\\Administrator\\node_modules\\readable-stream' npm WARN cleanup } npm WARN cleanup ] npm WARN cleanup ] npm ERR! code 1 npm ERR! path C:\Users\Administrator\node_modules\opencv4nodejs npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./install/install.js npm ERR! info install using lib dir: C:/Users/Administrator/node_modules/opencv-build/opencv/build/lib/Release npm ERR! C:\Users\Administrator\node_modules\opencv4nodejs\install\install.js:37 npm ERR! throw new Error('library dir does not exist: ' + libDir) npm ERR! ^ npm ERR! npm ERR! Error: library dir does not exist: C:/Users/Administrator/node_modules/opencv-build/opencv/build/lib/Release npm ERR! at Object.<anonymous> (C:\Users\Administrator\node_modules\opencv4nodejs\install\install.js:37:9) npm ERR! at Module._compile (node:internal/modules/cjs/loader:1254:14) npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) npm ERR! at Module.load (node:internal/modules/cjs/loader:1117:32) npm ERR! at Module._load (node:internal/modules/cjs/loader:958:12) npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) npm ERR! at node:internal/main/run_main_module:23:47 npm ERR! npm ERR! Node.js v18.16.0 npm ERR! A complete log of this run can be found in: npm ERR! H:\nodejs\node_cache\_logs\2023-05-15T14_05_10_717Z-debug-0.log
05-16
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值