我是 Node.js 的新手,我正在学习一些教程。出于某种原因,我无法安装任何新的节点模块。
我正在使用: Mac OSX 10.7.4 , Node v. 0.8.6, NPM v. 1.1.48。
我运行 npm install X 并且总是得到一个
npm ERR! fetch failed https://registry.npmjs.org/-/X
npm ERR! Error: 404 Not Found
当我真正去 npmjs 注册表时,我可以看到项目页面,但无论我点击哪个 tarball 链接,它总是一样的:
{
"error": "not_found",
"reason": "document not found"
}
例如,我尝试通过运行npm install fs来安装fs,我得到:
npm http GET https://registry.npmjs.org/fs
npm http 200 https://registry.npmjs.org/fs
npm http GET https://registry.npmjs.org/-/fs-0.0.0.tgz
npm http 404 https://registry.npmjs.org/-/fs-0.0.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/fs-0.0.0.tgz
npm ERR! Error: 404 Not Found
npm ERR! at null.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:47:16)
npm ERR! at EventEmitter.emit (events.js:115:20)
npm ERR! at WriteStream.flush (fs.js:1514:12)
npm ERR! at fs.close (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:92:5)
npm ERR! at Object.oncomplete (fs.js:297:15)
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-@googlegroups.com>
npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fs"
npm ERR! cwd /Users/comocomo/Documents/workspace/nodeTest
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/comocomo/Documents/workspace/nodeTest/npm-debug.log
npm ERR! not ok code 0
我尝试了 fs、fs-extra、express 和强大的,都给了我相同的 404 响应。我一定有什么问题,我很确定整个注册表没有损坏。
我使用的是旧注册表吗?我应该在我的配置文件中更改它吗?老实说,我宁愿不开始手动安装东西,我敢肯定这只是一个小配置问题。
谢谢!