安装body-parser v1.17.0时出错

时间:2017-03-03 20:44:22

标签: node.js windows express

我正在尝试使用安装body-parser npm install body-parser --save 我收到了这个错误

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program       Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "body-parser"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall getaddrinfo

npm ERR! enoent getaddrinfo ENOENT registry.npmjs.org:80
npm ERR! enoent getaddrinfo ENOENT registry.npmjs.org:80
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Omowumi\nodefirstapp\npm-debug.log
亲切的帮助 感谢

1 个答案:

答案 0 :(得分:2)

这不是节点错误,而是DNS错误。 尝试使用CMD运行:来自机器的'ping registry.npmjs.org'也应该失败。如果是这样,请将您的DNS设置为谷歌(8.8.8.8和8.8.4.4)