当我发出npm install mongoose --save
时,我收到了警告。我在El Capitan 10.11.1,Xcode 7.1.1 Build版本7B1005和npm 2.14.7。虽然一切正常(到目前为止),但我想进一步理解这一点。
Richards-MBP:app richardlu$ npm install mongoose --save
npm WARN peerDependencies The peer dependency kerberos@~0.0 included from mongodb-core will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
> kerberos@0.0.17 install /Users/richard/okcoders/boom/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
CXX(target) Release/obj.target/kerberos/lib/worker.o
CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
../lib/kerberosgss.c:509:13: warning: implicit declaration of function 'gss_acquire_cred_impersonate_name' is invalid in C99
[-Wimplicit-function-declaration]
maj_stat = gss_acquire_cred_impersonate_name(&min_stat,
^
1 warning generated.
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/kerberos.node
mongoose@4.2.5 node_modules/mongoose
├── ms@0.7.1
├── async@0.9.0
├── hooks-fixed@1.1.0
├── regexp-clone@0.0.1
├── mpromise@0.5.4
├── mpath@0.1.1
├── muri@1.0.0
├── sliced@0.0.5
├── kareem@1.0.1
├── bson@0.4.19
├── mquery@1.6.3 (bluebird@2.9.26)
└── mongodb@2.0.48 (es6-promise@2.1.1, readable-stream@1.0.31, kerberos@0.0.17, mongodb-core@1.2.21)
答案 0 :(得分:4)
对于其他人的某些背景。这个问题源于此:
failing to install mongoose npm
^此问题是错误,因为无法找到libgcc。
在您的情况下,有两个警告。首先是:
npm WARN peerDependencies The peer dependency kerberos@~0.0 included from mongodb-core will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
这些是NPM依赖性警告,声明(在这种情况下)mongodb-core
取决于kerberos
和(可能因为kerberos提供的定制功能对于mongodb-core来说不是完全必需的),它将来不会在npm
版本3+中安装mongodb-core的依赖项(如果需要,您将必须明确安装)。
第二个警告是:
warning: implicit declaration of function 'gss_acquire_cred_impersonate_name' is invalid in C99
这意味着,在C99标准中,不允许隐式函数声明(不提供标题签名 - 读取标题和实现文件)。但是,当构建kerberos
时,它们已经向C编译器提供了-Wimplicit-function-declaration
,告诉它抛出警告而不是错误(因此他们预计会发生这种情况)。