运行vue create my-project失败,错误为
assert.js:92
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: 293 == 0
at ClientRequest.onConnect (C:\Users\myname\.node_modules_global\node_modules\@vue\cli\node_modules\tunnel-agent\index.js:160:14)
at Object.onceWrapper (events.js:313:26)
at ClientRequest.emit (events.js:223:5)
at Socket.socketOnData (_http_client.js:490:11)
at Socket.emit (events.js:223:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:181:23) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 293,
expected: 0,
operator: '=='
}而node & npm安装可以正常运行。我在公司代理背后,我的版本是
@vue/cli 4.5.11
节点v12.14.1
npm 6.14.8
我可以毫无问题地ping https://registry.npmjs.org/。怎么了?
发布于 2021-02-03 17:04:41
我通过npm install -g @vue/cli@5.0.0-alpha.3安装了vue cli 5.0.0-alpha.3修复了这个问题。
它要求更改为TaobaoRegistry,因为https://registry.npmjs.org/似乎很慢。也许目前的稳定不包括这一点。
https://stackoverflow.com/questions/66005980
复制相似问题