atom-archive / node-runas

Run command synchronously (with Administrator privilege)
MIT License
47 stars 20 forks source link

`npm install runas` fails in OS X #18

Closed mrose-avenuecode closed 9 years ago

mrose-avenuecode commented 9 years ago

having trouble getting runas to install. here is an example session:

$ npm install runas
-
> runas@3.1.0 install /Users/mrose/git/api-workbench/node_modules/runas
> node-gyp rebuild

  CXX(target) Release/obj.target/runas/src/main.o
  CXX(target) Release/obj.target/runas/src/runas_darwin.o
  CXX(target) Release/obj.target/runas/src/fork.o
  SOLINK_MODULE(target) Release/runas.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/runas.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mrose/git/api-workbench/node_modules/runas
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/opt/local/bin/node" "/opt/local/bin/npm" "install" "runas"
npm ERR! node v0.12.7
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE

npm ERR! runas@3.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the runas@3.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the runas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls runas
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mrose/git/api-workbench/npm-debug.log

do i unserstand this error message correctly? it is looking for a rather old library?

ld: library not found for -lgcc_s.10.5

mrose-avenuecode commented 9 years ago

follow up: i have a different machine at home and it has no problem with npm install runas. on this one it installs just fine, no issues at all. it would be great to get some help understanding what might be the difference between the two.

thomasjo commented 9 years ago

Have you messed around with your linker paths perhaps? Try echo $DYLD_LIBRARY_PATH. As for the 10.5 bit, I'm pretty sure that refers to OS X 10.10.5, which also makes sense since you're indeed running Yosemite.

Another thing worth checking, have you updated the Xcode command line tools?

mrose-avenuecode commented 9 years ago

on both machines echo $DYLD_LIBRARY_PATH returns nothing. However, the machine where it installs successfully is running 10.11 and has a freshly installed Xcode 7.1 with command line tools. The machine where it fails is running 10.10 and does have Xcode and command line tools installed, but the version of Xcode is a bit outdated, it has 6.1. I will try updated Xcode and the command line tools.

mrose-avenuecode commented 9 years ago

Yup, that was it. The outdated version of Xcode was the culprit. Brought Xcode up to date on my 10.10 machine and now everything installs without a hitch. Thank you for your swift and sage advice.