0

我正在尝试安装 mongodb。我使用了命令 >npm install mongodb<,但它给出了以下响应:

npm ERR! bson@0.1.1 install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the bson@0.1.1 install script.
npm ERR! This is most likely a problem with the bson package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls bson
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mongodb"
npm ERR! cwd D:\GitHub
npm ERR! node -v v0.8.2
npm ERR! npm -v 1.1.36
npm ERR! code ELIFECYCLE
npm ERR! message bson@0.1.1 install: `node install.js`
npm ERR! message `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\GitHub\npm-debug.log
npm ERR! not ok code 0
4

1 回答 1

1

我相信该节点不在您的路径中,并且我相信 npm 会退出,因此如果它不在 PATH 中,它将无法找到它。因此,在您的情况下,添加C:\Program Files\nodejs到您的 Windows“PATH”环境变量。

于 2012-08-19T07:59:25.713 回答