【问题标题】:Nodejs with Express - Errors when adding mongoDB and mongoose to package.json and running npm install带有 Express 的 Nodejs - 将 mongoDB 和 mongoose 添加到 package.json 并运行 npm install 时出错
【发布时间】:2015-11-08 18:19:39
【问题描述】:

Windows 8.1
使用 Git Bash 表达起点
使用 python 2.7.10 进行 npm 安装以避免 3.4 问题

C编译器有问题吗?
我如何解决它?

package.json:

{
  "name": "nodeauth",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.13.2",
    "cookie-parser": "~1.3.5",
    "debug": "~2.2.0",
    "express": "~4.13.1",
    "jade": "~1.11.0",
    "morgan": "~1.6.1",
    "serve-favicon": "~2.3.0",
    "mongodb": "*",
    "mongoose": "*"
  }
}

以下日志用于包含 mongodb 和 mongoose ...我在仅包含 mongodb 时遇到了类似的警告:

$ npm install --python=c:\python27\python - > kerberos@0.0.12 安装 e:\nodejs\_projects\nodeauth\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos > (node-gyp 重建 2> builderror.log) || (0号出口) e:\nodejs\_projects\nodeauth\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>如果没有定义 npm_config_node_gyp (节点 "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" 重建)否则(点头 e\重建) 一次在此解决方案中构建项目。要启用并行构建,请添加“/m”开关。 kerberos.cc 工人.cc 安全缓冲区.cc security_buffer_descriptor.cc security_context.cc security_credentials.cc C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_buffer.cc) [e:\nodejs\_projects\nodeauth\node_modules\mong odb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] -C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_context.cc) [e:\nodejs\_projects\nodeauth\node_modules\mon C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_buffer_descriptor.cc) [e:\nodejs\_projects\nodeauth\node_m odules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_credentials.cc) [e:\nodejs\_projects\nodeauth\node_modules \mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] base64.c kerberos_sspi.c 创建库 e:\nodejs\_projects\nodeauth\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\Relea se\kerberos.lib 和对象 e:\nodejs\_projects\nodeauth\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\buil d\Release\kerberos.exp 生成代码 完成生成代码 kerberos.vcxproj -> e:\nodejs\_projects\nodeauth\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\Relea se\\kerberos.node npm WARN installMany nopt 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany npmlog 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany 请求与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany semver 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany tar 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany tar-pack 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany mkdirp 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany rc 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 npm WARN installMany rimraf 与 node-pre-gyp@0.6.4 捆绑在一起,但在解压树中找不到捆绑包 > kerberos@0.0.12 安装 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_mod ules\kerberos > (node-gyp 重建 2> builderror.log) || (0号出口) \ e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos>如果没有定义 ed npm_config_node_gyp (节点 "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js " 重建 ) 否则 (节点重建 ) 一次在此解决方案中构建项目。要启用并行构建,请添加“/m”开关。 kerberos.cc 工人.cc 安全缓冲区.cc security_buffer_descriptor.cc security_context.cc security_credentials.cc C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_buffer.cc) [e:\nodejs\_projects\nodeauth\node_modules\mong oose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_buffer_descriptor.cc) [e:\nodejs\_projects\nodeauth\node_m odules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_context.cc) [e:\nodejs\_projects\nodeauth\node_modules\mon goose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337):警告 C4530:使用 C++ 异常处理程序,但展开 语义未启用。指定 /EHsc (..\lib\win32\wrappers\security_credentials.cc) [e:\nodejs\_projects\nodeauth\node_modules \mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\kerberos.vcxproj] base64.c kerberos_sspi.c 创建库 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_module s\kerberos\build\Release\kerberos.lib 和对象 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\mongodb\node_mod ules\mongodb-core\node_modules\kerberos\build\Release\kerberos.exp 生成代码 完成生成代码 kerberos.vcxproj -> e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_module s\kerberos\build\Release\\kerberos.node > bson-ext@0.1.12 安装 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext > (node-pre-gyp install --fallback-to-build) || (node-gyp 重建 2> builderror.log) || (0号出口) e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>如果未定义 npm_config_node_gyp(节点 "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node clean ) e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>如果未定义 npm_config_node_gyp(节点 "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" 配置 --fallback-to-bui ld --module=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\bson.node --mod ule_name=bson --module_path=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release --python=c:python27python )否则(节点配置 --fallback-to-build --module=e:\nodejs\_projects\nodeauth\node_modules\mongoose\ node_modules\bson\node_modules\bson-ext\build\Release\bson.node --module_name=bson --module_path=e:\nodejs\_projects\nodeauth\node_m odules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release --python=c:python27python) e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext>如果未定义 npm_config_node_gyp(节点 "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" 构建 --fallback-to-build - -module=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\bson.node --module_ 名称=bson --module_path=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release ) 否则(节点构建 --fallback-to-build --module=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bso n-ext\build\Release\bson.node --module_name=bson --module_path=e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\ node_modules\bson-ext\build\Release ) 一次在此解决方案中构建项目。要启用并行构建,请添加“/m”开关。 bson.cc ..\ext\bson.cc(688):警告 C4267:'argument':从 'size_t' 转换为 'uint32_t',可能丢失数据 [e:\nodejs\_projects \nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\bson.vcxproj] ..\ext\bson.cc(902):警告 C4267:'argument':从 'size_t' 转换为 'uint32_t',可能丢失数据 [e:\nodejs\_projects \nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\bson.vcxproj] e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\node_modules\nan\nan_new.h(208):警告 C4244:'argument':从 'int64_t' 转换为 'double',可能丢失数据 [e:\nodejs\_projects\nodeauth\node_modules\mongoo se\node_modules\bson\node_modules\bson-ext\build\bson.vcxproj] ..\ext\bson.cc(568) : 参见函数模板实例化 'v8::Local NanNew( A0)' 正在编译 和 [ A0=int64_t ] ..\ext\bson.cc(339):警告 C4267:“初始化”:从“size_t”转换为“uint32_t”,可能丢失数据 [e:\nodejs\_proj ects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\bson.vcxproj] ..\ext\bson.cc(153) : 在编译类模板成员函数'void BSONSerializer::SerializeValue(voi d *,const v8::Handle,bool)' ..\ext\bson.cc(123) :参见对函数模板实例化的参考 'void BSONSerializer::SerializeValue(v oid *,const v8::Handle,bool)' 正在编译 ..\ext\bson.cc(103) : 在编译类模板成员函数'void BSONSerializer::SerializeDocument( const v8::句柄 &)' ..\ext\bson.cc(879) :参见对函数模板实例化的参考 'void BSONSerializer::SerializeDocumen t(const v8::Handle &)' 正在编译 ..\ext\bson.cc(878) : 请参阅正在编译的类模板实例化“BSONSerializer”的参考 win_delay_load_hook.c 创建库 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\bson .lib 和对象 e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\bson.exp 生成代码 完成生成代码 bson.vcxproj -> e:\nodejs\_projects\nodeauth\node_modules\mongoose\node_modules\bson\node_modules\bson-ext\build\Release\\bson.no 德 cookie-parser@1.3.5 node_modules\cookie-parser ├── cookie-signature@1.0.6 └── cookie@0.1.3 debug@2.2.0 node_modules\debug └── ms@0.7.1 serve-favicon@2.3.0 node_modules\serve-favicon ├── ms@0.7.1 ├── etag@1.7.0 ├── parseurl@1.3.0 └── 新鲜@0.3.0 摩根@1.6.1 节点模块\摩根 ├── basic-auth@1.0.3 ├── on-headers@1.0.0 ├── depd@1.0.1 └── on-finished@2.3.0 (ee-first@1.1.1) body-parser@1.13.3 node_modules\body-parser ├── bytes@2.1.0 ├── content-type@1.0.1 ├── depd@1.0.1 ├── on-finished@2.3.0 (ee-first@1.1.1) ├── qs@4.0.0 ├── raw-body@2.1.2 (unpipe@1.0.0) ├── iconv-lite@0.4.11 ├── http-errors@1.3.1 (inherits@2.0.1, statuses@1.2.1) └── type-is@1.6.6 (media-typer@0.3.0, mime-types@2.1.4) express@4.13.3 node_modules\express ├── escape-html@1.0.2 ├── 合并描述符@1.0.0 ├── cookie@0.1.3 ├── array-flatten@1.1.1 ├── cookie-signature@1.0.6 ├── 新鲜@0.3.0 ├── 方法@1.1.1 ├── range-parser@1.0.2 ├── 变化@1.0.1 ├── etag@1.7.0 ├── content-type@1.0.1 ├── 正则表达式路径@0.1.7 ├── utils-merge@1.0.0 ├── parseurl@1.3.0 ├── 服务静态@1.10.0 ├── 内容配置@0.5.0 ├── depd@1.0.1 ├── on-finished@2.3.0 (ee-first@1.1.1) ├── finalhandler@0.4.0 (unpipe@1.0.0) ├── qs@4.0.0 ├── proxy-addr@1.0.8 (forwarded@0.1.0, ipaddr.js@1.0.1) ├── send@0.13.0 (destroy@1.0.3, ms@0.7.1, statuses@1.2.1, mime@1.3.4, http-errors@1.3.1) ├── type-is@1.6.6 (media-typer@0.3.0, mime-types@2.1.4) └── 接受@1.2.12 (negotiator@0.5.3, mime-types@2.1.4) jam@1.11.0 node_modules\jade ├── 字符解析器@1.2.1 ├── void-elements@2.0.1 ├── 指挥官@2.6.0 ├── jstransformer@0.0.2 (is-promise@2.0.0, promise@6.1.0) ├── mkdirp@0.5.1 (minimist@0.0.8) ├── constantinople@3.0.2 (acorn@2.2.0) ├── with@4.0.3 (acorn@1.2.2, acorn-globals@1.0.5) ├── uglify-js@2.4.24 (uglify-to-browserify@1.0.2, async@0.2.10, yargs@3.5.4, source-map@0.1.34) ├── clean-css@3.3.9 (commander@2.8.1, source-map@0.4.4) └── transformers@2.1.0 (promise@2.0.0, css@1.0.8, uglify-js@2.2.5) mongodb@2.0.41 node_modules\mongodb ├── es6-promise@2.1.1 ├── 可读流@1.0.31 (inherits@2.0.1, isarray@0.0.1, string_decoder@0.10.31, core-util-is@1.0.1) └── mongodb-core@1.2.10 (bson@0.4.11, kerberos@0.0.12) mongoose@4.1.2 node_modules\mongoose ├── 正则表达式克隆@0.0.1 ├── 切片@0.0.5 ├── muri@1.0.0 ├── mpromise@0.5.4 ├── hooks-fixed@1.1.0 ├── kareem@1.0.1 ├── mpath@0.1.1 ├── async@0.9.0 ├── ms@0.1.0 ├── mquery@1.6.1 (bluebird@2.9.26) ├── mongodb@2.0.40 (可读流@1.0.31, es6-promise@2.1.1, mongodb-core@1.2.9) └── bson@0.3.2 (bson-ext@0.1.12) 詹姆斯@13JY1W1 /E/nodejs/_projects/nodeauth $ npm 开始 > nodeauth@0.0.0 启动 e:\nodejs\_projects\nodeauth > 节点 ./bin/www

【问题讨论】:

    标签: json node.js mongodb express mongoose


    【解决方案1】:

    这里没有错误,模块安装成功。各种与编译器相关的消息只是警告,但编译是成功的。

    【讨论】:

      猜你喜欢
      • 2015-09-02
      • 2014-09-11
      • 2018-11-22
      • 1970-01-01
      • 2015-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多