我无法使用npm安装mongodb和mongoose。任何建议将不胜感激!我看到一篇较早的帖子,他们说要清除缓存和更新 - 这已经完成但仍然是同样的问题......下面是mongo db安装的错误,但它对于mongoose几乎完全相同
各种从服务器日志中获取...
> mongodb@0.9.9-2 install C:\Users\petrov\Desktop\nodejs\node_modules\mongodb
> node install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! error installing mongodb@0.9.9-2
npm ERR! mongodb@0.9.9-2 install: `node install.js`
npm ERR! `cmd "/c" "node install.js"` failed with 1
npm ERR!
npm ERR! Failed at the mongodb@0.9.9-2 install script.
npm ERR! This is most likely a problem with the mongodb 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 mongodb
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\petrov\\Desktop\\nodejs\\\\node.exe"
"C:\\Users\\petrov\\Desktop\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mongodb"
npm ERR! cwd C:\Users\petrov\Desktop\nodejs
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! code ELIFECYCLE
npm ERR! message mongodb@0.9.9-2 install: `node install.js`
npm ERR! message `cmd "/c" "node install.js"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\petrov\Desktop\nodejs\npm-debug.log
npm not ok
答案 0 :(得分:3)
检查安装节点的路径,或者从安装节点的同一目录运行命令。
答案 1 :(得分:2)
尝试npm -dd install mongodb
它可能适合你。 npm中似乎有一个错误
答案 2 :(得分:1)
对于那些仍然遇到此问题的人,我通过将nodejs安装路径(对我而言C:\Program Files (x86)\nodejs\
)添加到我的本地PATH环境变量来解决它。