Windows10安装Remix踩过的坑

Windows10安装Remix踩过的坑

npm ERR! code 128

24060 verbose stack Error: Command failed: git clone --depth=1 -q -b browserifyCompatible git://github.com/frozeman/WebSocket-Node.git D:\nodejs\node_cache_cacache\tmp\git-clone-d374c3d0 --config core.longpaths=true
24060 verbose stack warning: templates not found in C:\Users\Xinzhe\AppData\Local\Temp\pacote-git-template-tmp\git-clone-12631386
24060 verbose stack fatal: read error: Invalid argument
24060 verbose stack
24060 verbose stack at ChildProcess.exithandler (child_process.js:295:12)
24060 verbose stack at ChildProcess.emit (events.js:210:5)
24060 verbose stack at maybeClose (internal/child_process.js:1021:16)
24060 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
24061 verbose cwd D:\remix-ide-master\remix-ide
24062 verbose Windows_NT 10.0.18362
24063 verbose argv “D:\nodejs\node.exe” “D:\nodejs\node_modules\npm\bin\npm-cli.js” “install”
24064 verbose node v12.13.0
24065 verbose npm v6.12.0
24066 error code 128
24067 error Command failed: git clone --depth=1 -q -b browserifyCompatible git://github.com/frozeman/WebSocket-Node.git D:\nodejs\node_cache_cacache\tmp\git-clone-d374c3d0 --config core.longpaths=true
24067 error warning: templates not found in C:\Users\Xinzhe\AppData\Local\Temp\pacote-git-template-tmp\git-clone-12631386
24067 error fatal: read error: Invalid argument
24068 verbose exit [ 1, true ]
remix安装的坑
执行步骤:

第一步执行:git config --global url.“https://”.insteadOf git://

第二步执行:npm install

其他相关的解决方案参考:https://github.com/npm/npm/issues/16980

TypeError: err.code.match is not a function

这个问题一般在npm 6.10.0版本之前出现,主要原因是由于nodejs下的D:\nodejs\node_modules\npm\node_modules\pacote\lib目录里边的with-tarball-stream.js中对err的判断不全面所致:

......
110		if (opts.cache && err.code && !err.code.match(/^E\d{3}$/)) {
......

原文意思是:错误状态码是一个数字,而不是一个字符串,而且数值表型没有一个匹配函数(The issue is that err.code is a Number, not a String, and the Number prototype does not have a match function.),因此npm官方在6.10.0之后的版本中将这段代码修改为如下:

110		if (opts.cache && err.code && !String(err.code).match(/^E\d{3}$/)) {
......

该问题的详细说明,参考https://github.com/zkat/pacote/pull/170

发布了279 篇原创文章 · 获赞 169 · 访问量 32万+

猜你喜欢

转载自blog.csdn.net/ARPOSPF/article/details/105337505