nexe学习-克隆项目报错

43 篇文章 1 订阅
1 篇文章 0 订阅

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.

这里就成功了,克隆项目时可能遇到的问题,记录下…

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值