nexe学习中,遇到了个问题:
git上克隆了一个项目 git上项目地址,
git clone git@github.com:nexe/nexe.git
cd nexe
在运行
yarn
报错:
yarn
yarn install v0.21.3
(node:11648) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. P
lease use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info No lockfile found.
[1/4] Resolving packages...
error Received malformed response from registry for undefined. The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
然后我使用npm i
$ npm i
npm ERR! code E500
npm ERR! 500 Internal Server Error - GET https://registry.npm.taobao.org/unbzip2-stream/download/unbzip2-stream-1.2.5.tgz
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zoe\AppData\Roaming\npm-cache\_logs\2019-02-14T08_08_22_614Z-debug.log
考虑到可能是淘宝镜像不稳定:
$ npm config list
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.6.0 node/v10.15.0 win32 x64"
; userconfig C:\Users\zoe\.npmrc
disturl = "https://npm.taobao.org/dist"
registry = "https://registry.npm.taobao.org/"
; builtin config undefined
prefix = "C:\\Users\\zoe\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = E:\aPritice\JieDe\nexe\nexedownload
; HOME = C:\Users\zoe
; "npm config ls -l" to show all defaults.
看完列表,移除已经设置的镜像源:
$ npm config rm registry
在看下列表:
$ npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.6.0 node/v10.15.0 win32 x64"
; userconfig C:\Users\zoe\.npmrc
disturl = "https://npm.taobao.org/dist"
; builtin config undefined
prefix = "C:\\Users\\zoe\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = E:\aPritice\JieDe\nexe\nexedownload
; HOME = C:\Users\zoe
; "npm config ls -l" to show all defaults.
然后把镜像源设置为官方的
$ npm set registry "http://registry.npmjs.org/"
随后就可以重新执行:yarn
yarn
随后就可以输入命令,试下test:
yarn test
会看到如下内容:
$ yarn test
yarn test v0.21.3
(node:13616) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use t
he Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ mocha
options
cwd
√ should use process.cwd() if nothing is provided
√ should use the main module in a package directory
√ should resolve relative paths for input
√ should accept a module entry as input
√ should resolve pathed options against cwd
output
√ should work
√ should default to the input file name if not index
√ should default to the folder/project name if filename is index
Targets
√ should accept: "win-ia32-6.11.2" -> windows-x86-6.11.2
√ should accept: {"version":"6.11.2","platform":"win","arch":"ia32"} -> windows-x86-6.11.2
√ should accept: "win32-x64-6.11.2" -> windows-x64-6.11.2
√ should accept: "win-amd64-6.11.2" -> windows-x64-6.11.2
√ should accept: "darwin-x64-v8.4.0" -> mac-x64-8.4.0
√ should accept: "macos-x64-v8.4.0" -> mac-x64-8.4.0
√ should accept: "static-x86-6.10.3" -> alpine-x86-6.10.3
√ should accept: "linux-x32" -> linux-x86-10.15.0
√ should accept: "alpine-notsupported-6.10.3" -> alpine-x64-6.10.3
√ should accept: "not-a-thing" -> windows-x64-10.15.0
√ should stringify and toString
19 passing (60ms)
Done in 10.08s.
这里就成功了,克隆项目时可能遇到的问题,记录下…