在进行npm安装时,node-gyp构建错误

时间:2015-03-12 06:11:35

标签: node.js mongoose npm kerberos bson

我正在尝试通过npm安装mongoose,但它会为bson和kerberos模块抛出构建错误。我今天在Windows 7平台上运行最新的节点js。

我的package.json看起来像这样:

    {
  "name": "meanApp",
  "version": "1.0.0",
  "description": "Mean Stack Web Application",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/theScratchLad/meanapp.git"
  },
  "author": "satyajitPatnaik",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/theScratchLad/meanapp/issues"
  },
  "homepage": "https://github.com/theScratchLad/meanapp",
  "dependencies": {
    "connect": "^3.3.4",
    "ejs": "^2.3.1",
    "express": "^4.12.2",
    "mongodb": "^1.4.34",
    "mongoose": "^3.8.24"
  }
}

在执行npm install --save mongoose时,进程会抛出以下错误/结果(我不确定,看到日志文件,看起来有构建错误)。

$ npm install --save mongoose
/
> bson@0.2.19 install e:\git\gitTest\meanapp\node_modules\mongoose\node_modules\
mongodb\node_modules\bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)


e:\git\gitTest\meanapp\node_modules\mongoose\node_modules\mongodb\node_modules\b
son>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_
modules\node-gyp\bin\node-gyp.js" rebuild

> kerberos@0.0.9 install e:\git\gitTest\meanapp\node_modules\mongoose\node_modul
es\mongodb\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)


e:\git\gitTest\meanapp\node_modules\mongoose\node_modules\mongodb\node_modules\k
erberos>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\n
ode_modules\node-gyp\bin\node-gyp.js" rebuild
mongoose@3.8.24 node_modules\mongoose
├── regexp-clone@0.0.1
├── sliced@0.0.5
├── muri@0.3.1
├── hooks@0.2.1
├── mpath@0.1.1
├── mpromise@0.4.3
├── ms@0.1.0
├── mquery@0.8.0 (debug@0.7.4)
└── mongodb@1.4.31 (readable-stream@1.0.33, bson@0.2.19, kerberos@0.0.9)

在运行node server(server.js是运行我的节点js web应用程序的主要js文件)时,我面临以下控制台错误。

SA269817@D-113051982 /E/git/gitTest/meanapp (master)
$ node server
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

js-bson: Failed to load c++ bson extension, using pure JS version
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Trying to open unclosed connection.
    at NativeConnection.Connection.open (e:\git\gitTest\meanapp\node_modules\mon
goose\lib\connection.js:210:15)
    at Mongoose.connect (e:\git\gitTest\meanapp\node_modules\mongoose\lib\index.
js:212:15)
    at module.exports (e:\git\gitTest\meanapp\config\mongoose.js:5:20)
    at Object.<anonymous> (e:\git\gitTest\meanapp\server.js:9:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

有人可以帮我解决这个问题吗?由于我的MEAN堆栈Web应用程序出现此错误,我确实陷入困境。

编辑:

的Kerberos / builderror.log

gyp ERR! configure error 
gyp ERR! stack Error: spawn c:/Python27 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
gyp ERR! stack     at child_process.js:1137:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd e:\git\gitTest\meanapp\node_modules\mongoose\node_modules\mongodb\node_modules\kerberos
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

BSON / builderror.log

gyp ERR! configure error 
gyp ERR! stack Error: spawn c:/Python27 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:746:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
gyp ERR! stack     at child_process.js:1137:20
gyp ERR! stack     at process._tickCallback (node.js:355:11)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd e:\git\gitTest\meanapp\node_modules\mongoose\node_modules\mongodb\node_modules\bson
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

0 个答案:

没有答案