failing to install mongoose npm

2019-03-01 00:47发布

问题:

I am installing mongoose as an npm. I am getting back a bunch of errors. I did a npm install of npm install -g node-gyp from a post I read about with a similar problem. However, my problem did not seem to go away. I am not able to problem solve the warning on this one. Any insight would be hugely appreciated.

   ../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
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/kerberos.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/stevenkauyedauty/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/Users/stevenkauyedauty/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/stevenkauyedauty/projects/controllerAs/beerRecipes/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 

回答1:

It is complaining about the library lgcc_s.10.5 not existing on your system. You can see a similar issue with Homebrew here. If you are on Mac, then the proposed solution is to upgrade to XCode 7.

Figure out your XCode version:

vinay@chocobo-2:~ $ xcodebuild -version
Xcode 7.0.1