FussyCat 2019-04-12 17:59 采纳率: 0%
浏览 3887
已采纳

cnpm install执行时,出现Error [ERR_STREAM_WRITE_AFTER_END]

近期在安装vue的整套环境,结果在最后一步拉取依赖文件时出现了Error [ERR_STREAM_WRITE_AFTER_END]
下面我说明下安装步骤:
1. 安装nodejs,确定成功装了node和npm,两者的版本分别是v10.15.3和v6.4.1
2. 安装淘宝镜像(因为我直接访问国外服务器,是一直timeout的),确定cnpm成功安装
3. 安装electron,确定成功装了,版本是v4.1.4
4. 安装vue
5. 创建个脚手架(模板)
6. 拉取依赖文件到node_modules,好吧,到[54/58]时挂了,error了。

有谁有遇到过类似的问题吗,请各位大神指点啊。
以下是第6步操作出的error内容:

Error [ERR_STREAM_WRITE_AFTER_END]: write after end (writeStream "error") (writeStream "error"), GET https://cdn.npm.taobao.org/app-builder-bin/-/app-builder-bin-2.6.4.tgz 200 (connected: true, keepalive socket: false, agent status: {"createSocketCount":70,"createSocketErrorCount":0,"closeSocketCount":68,"errorSocketCount":0,"timeoutSocketCount":4,"requestCount":2463,"freeSockets":{},"sockets":{"cdn.npm.taobao.org:443::::::::true::::::::":2},"requests":{}}, socketHandledRequests: 1, socketHandledResponses: 1)
headers: {"server":"Tengine","content-type":"application/octet-stream","content-length":"34353169","connection":"keep-alive","date":"Wed, 10 Apr 2019 03:51:22 GMT","x-oss-request-id":"5CAD683AB1E9EC94B380C4A0","accept-ranges":"bytes","etag":"\"52CE328FB03990A3D297D6A5B1088B9E\"","last-modified":"Tue, 26 Feb 2019 07:41:51 GMT","x-oss-object-type":"Normal","x-oss-hash-crc64ecma":"34131763972269000","x-oss-storage-class":"Standard","cache-control":"max-age=0, s-maxage=86400","x-oss-server-time":"205","age":"172947","ali-swift-global-savetime":"1554868282","x-cache":"HIT TCP_MEM_HIT dirn:11:298812429 mlen:0","x-swift-savetime":"Wed, 10 Apr 2019 03:51:22 GMT","x-swift-cachetime":"194318","via":"cache2.cn1414[0,206-0,H], cache5.cn1414[1,0]","timing-allow-origin":"*","eagleid":"af061d9915550412296928509e"}
    at writeAfterEnd (_stream_writable.js:243:12)
    at WriteStream.Writable.write (_stream_writable.js:291:5)
    at IncomingMessage.ondata (_stream_readable.js:689:20)
    at IncomingMessage.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at IncomingMessage.Readable.push (_stream_readable.js:220:10)
    at HTTPParser.parserOnBody (_http_common.js:122:22)
    at TLSSocket.socketOnData (_http_client.js:442:20)
    at TLSSocket.emit (events.js:189:13)

再附个截图:

  • 写回答

3条回答 默认 最新

  • FussyCat 2019-04-19 19:44
    关注

    上述问题的解决方法是放弃了cnpm,使用npm:

    npm config set registry https://registry.npm.taobao.org
    

    几天前解决了这个问题了,但一直没有时间整理,现在把完整的安装流程捋了一遍,并整理到博文中,需要了解的可进我博文看,包含了安装流程和问题解决。
    需要的请见Electron-Vue之安装流程

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 QTableWidget重绘程序崩溃
  • ¥15 51寻迹小车定点寻迹
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含
  • ¥15 麒麟V10桌面版SP1如何配置bonding