无法为 nodejs (windows) 安装 mongodb 依赖项 [英] Can't install mongodb dependencies for nodejs (windows)

查看:35
本文介绍了无法为 nodejs (windows) 安装 mongodb 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 nodejs 运行 mongo 数据库,但是当我在命令行中键入npm install mongodb"时,出现以下错误:

<前>C:\Users\me>npm 安装 mongodbnpm http GET https://registry.npmjs.org/mongodbnpm http 304 https://registry.npmjs.org/mongodbnpm http GET https://registry.npmjs.org/bson/0.1.3npm http 304 https://registry.npmjs.org/bson/0.1.3npm WARN package.json bson@0.1.3 没有找到 README.md 文件!> bson@0.1.3 安装 C:\Users\me\node_modules\mongodb\node_modules\bson> 节点安装.jsCreateProcessW: 系统找不到指定的文件.npm 错误!bson@0.1.3 安装:`node install.js`npm 错误!`cmd "/c" "node install.js"` 失败 127npm 错误!npm 错误!bson@0.1.3 安装脚本失败.npm 错误!这很可能是 bson 包的问题,npm 错误!不是 npm 本身.npm 错误!告诉作者这在您的系统上失败:npm 错误!节点安装.jsnpm 错误!您可以通过以下方式获取他们的信息:npm 错误!npm 所有者 ls bsonnpm 错误!上面可能有额外的日志输出.npm 错误!系统 Windows_NT 6.1.7601npm 错误!命令 "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_m模块\\npm\\bin\\npm-cli.js"安装"mongodb"npm 错误!cwd C:\用户\我npm 错误!节点 -v v0.8.9npm 错误!npm -v 1.1.61npm 错误!代码生命周期npm 错误!npm 错误!可以在以下位置找到其他日志记录详细信息:npm 错误!C:\Users\me\npm-debug.lognpm 错误!不行 代码 0C:\用户\我>

似乎是 bson0.1.3 的问题.有谁知道我可能会去解决这个问题?我使用的是 64 位 Windows 7,nodejs 版本 0.8.9,npm 版本 1.1.61,并且当前安装了 mongodb 版本 2.2.0.

解决方案

npm 调用 CreateProcessW 需要您的 cmd 的管理员权限.

I'm trying to get a mongo database running with nodejs but when I type 'npm install mongodb' into my command line, I am getting the following error:


    C:\Users\me>npm install mongodb
    npm http GET https://registry.npmjs.org/mongodb
    npm http 304 https://registry.npmjs.org/mongodb
    npm http GET https://registry.npmjs.org/bson/0.1.3
    npm http 304 https://registry.npmjs.org/bson/0.1.3
    npm WARN package.json bson@0.1.3 No README.md file found!

    > bson@0.1.3 install C:\Users\me\node_modules\mongodb\node_modules\bson
    > node install.js

    CreateProcessW: The system cannot find the file specified.
    npm ERR! bson@0.1.3 install: `node install.js`
    npm ERR! `cmd "/c" "node install.js"` failed with 127
    npm ERR!
    npm ERR! Failed at the bson@0.1.3 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\\nodejs\\node_m
    odules\\npm\\bin\\npm-cli.js" "install" "mongodb"
    npm ERR! cwd C:\Users\me
    npm ERR! node -v v0.8.9
    npm ERR! npm -v 1.1.61
    npm ERR! code ELIFECYCLE
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     C:\Users\me\npm-debug.log
    npm ERR! not ok code 0

    C:\Users\me>

 

It seems that bson0.1.3 is the issue. Does anyone know I might go about resolving this? I am using 64bit Windows 7, nodejs version 0.8.9, npm version 1.1.61 and have mongodb version 2.2.0 currently installed.

解决方案

Administrator permission of your cmd is required for npm to invoke CreateProcessW.

这篇关于无法为 nodejs (windows) 安装 mongodb 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆