node.js - Win7 nodejs 安装express 错误

 mobiledu2502853463 发布于 2022-11-06 11:50
D:\servers\nodejs>npm install express -g
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/cookie/0.0.5
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/connect/2.7.2
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/cookie-signature/0.0.1
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/buffer-crc32/0.1.1
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 304 https://registry.npmjs.org/cookie/0.0.5
npm http 304 https://registry.npmjs.org/connect/2.7.2
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm http 304 https://registry.npmjs.org/cookie-signature/0.0.1
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/buffer-crc32/0.1.1
npm WARN package.json methods@0.0.1 No README.md file found!
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/qs/0.5.1
npm http GET https://registry.npmjs.org/formidable/1.0.11
npm http GET https://registry.npmjs.org/bytes/0.1.0
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/qs/0.5.1
npm http 304 https://registry.npmjs.org/formidable/1.0.11
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/bytes/0.1.0
C:\Users\Aries\AppData\Roaming\npm\express -> C:\Users\Aries\AppData\Roaming\npm
\node_modules\express\bin\express
express@3.1.0 C:\Users\Aries\AppData\Roaming\npm\node_modules\express
├── methods@0.0.1
├── fresh@0.1.0
├── range-parser@0.0.4
├── cookie-signature@0.0.1
├── buffer-crc32@0.1.1
├── cookie@0.0.5
├── debug@0.7.2
├── commander@0.6.1
├── mkdirp@0.3.3
├── send@0.1.0 (mime@1.2.6)
└── connect@2.7.2 (pause@0.0.1, bytes@0.1.0, qs@0.5.1, formidable@1.0.11)
npm ERR! Error: read ECONNRESET
npm ERR!     at errnoException (net.js:863:11)
npm ERR!     at TCP.onread (net.js:524:19)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>;
npm ERR! or email it to:
npm ERR!     

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\\servers\\nodejs\\\\node.exe" "D:\\servers\\nodejs\\node_mo
dules\\npm\\bin\\npm-cli.js?1.2.1" "install" "express" "-g"
npm ERR! cwd D:\servers\nodejs
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! syscall read
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\servers\nodejs\npm-debug.log
npm ERR! not ok code 0

D:\servers\nodejs>

貌似不成功
然后又

$ git clone git://github.com/visionmedia/express.git --depth 1
$ cd express
$ npm install
2 个回答
  • 既然用了node,就不要在windows上开发了。完全可以装个虚拟的ubuntu进行开发。

    不要怕麻烦,linux没接触过的话,看着复杂,其实熟悉了以后,会觉得比windows好很多。

    不是说windows里就不能用node。但用了ubuntu(或者mac)开发node后,你绝对就不再想用windows了

    2022-11-11 09:58 回答
  • 连接被重置了, 你换个国内的镜像试试:

    npm --registry http://npm.stdyun.com install -g express

    2022-11-11 10:11 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有