ios-control / ios-deploy

Install and debug iPhone apps from the command line, without using Xcode
GNU General Public License v3.0
3.32k stars 462 forks source link

Command fails: npm install ios-deploy -g #109

Closed guiix-code closed 9 years ago

guiix-code commented 9 years ago

OSX 10.10.2. ios-deploy: command not found Xcode 6.2 (Build 6C131e) /Applications/Xcode.app/Contents/Developer

gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix

clang --version Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix

Doing an upgrade from Cordova iOS 3.5. Updated cordova to 4.3.

Running command (as root):

npm install ios-deploy -g

Error:

ios-deploy@1.4.0 preinstall /usr/local/lib/node_modules/ios-deploy make ios-deploy

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied make: getcwd: Permission denied rm -rf .app demo ios-deploy shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied gcc -ObjC -g -o ios-deploy -framework Foundation -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c clang: error: unable to make temporary file: Permission denied make: ** [ios-deploy] Error 1 npm ERR! ios-deploy@1.4.0 preinstall: make ios-deploy npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the ios-deploy@1.4.0 preinstall script. npm ERR! This is most likely a problem with the ios-deploy package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! make ios-deploy npm ERR! You can get their info via: npm ERR! npm owner ls ios-deploy npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.1.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "ios-deploy" "-g" npm ERR! cwd /usr/local/bin npm ERR! node -v v0.10.30 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /usr/local/bin/npm-debug.log npm ERR! not ok code 0

Have tried switching from gcc to clang. Both produce the same error.

I had tried to fix permissions where it had indicated. The script successfully creates (and later removes) the directory:

/usr/local/lib/node_modules/ios-deploy

But can't seem to write inside the directory it creates (even as root). Unless there's another location it is trying to access?

shazron commented 9 years ago

Does installing other npm modules globally work? The module does attempt to build a binary, and may use the tmp folder, not sure.

guiix-code commented 9 years ago

Other npm modules install globally fine, yes.

Is there any way to check which file it fails to get permissions for?

shazron commented 9 years ago

You could try download the source: http://github.com/phonegap/ios-deploy and run "make" to see if that causes problems if that doesn't it might be wherever node tries to install it.

guiix-code commented 9 years ago

Oddly enough, making ios-deploy-master by itself works fine. But not "npm install ios-deploy -g"

guiix-code commented 9 years ago

The npm-debug.log file has the following lines of interest:

56 verbose tar unpacking to /usr/local/lib/node_modules/ios-deploy 57 verbose gentlyRm vacuuming /usr/local/lib/node_modules/ios-deploy 58 silly gunzTarPerm modes [ '755', '644' ] 59 silly gunzTarPerm extractEntry package.json 60 silly gunzTarPerm extractEntry .npmignore 61 silly gunzTarPerm extractEntry README.md 62 silly gunzTarPerm extractEntry LICENSE 63 silly gunzTarPerm extractEntry resources/buildbox/build.sh 64 silly gunzTarPerm extractEntry Makefile 65 silly gunzTarPerm extractEntry CONTRIBUTING.md 66 silly gunzTarPerm extractEntry Entitlements.plist 67 silly gunzTarPerm extractEntry ResourceRules.plist 68 silly gunzTarPerm extractEntry demo.c 69 silly gunzTarPerm extractEntry ios-deploy.c 70 silly gunzTarPerm extractEntry Info.plist 71 silly gunzTarPerm extractEntry MobileDevice.h 72 info preinstall ios-deploy@1.5.0 73 verbose unsafe-perm in lifecycle false 74 info ios-deploy@1.5.0 Failed to exec preinstall script 75 verbose unlock done using /Users/Henry/.npm/_locks/ios-deploy-198957223cd98201.lock for /usr/local/lib/node_modules/ios-deploy 76 verbose stack Error: ios-deploy@1.5.0 preinstall: make ios-deploy 76 verbose stack Exit status 2 76 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16) 76 verbose stack at EventEmitter.emit (events.js:110:17) 76 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12) 76 verbose stack at ChildProcess.emit (events.js:110:17) 76 verbose stack at maybeClose (child_process.js:1008:16) 76 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5) 77 verbose pkgid ios-deploy@1.5.0

guiix-code commented 9 years ago

Fix found:

sudo npm install --global --unsafe-perm ios-deploy

caroso1222 commented 8 years ago

Thanks doomsy. This did the trick for me

aotian16 commented 8 years ago

Thanks to doomsy. Help me a lot

EricGlaenzer commented 8 years ago

Yes thank you doomsy! It did work for me too.

travisbmiller commented 8 years ago

worked for me as well! Thank you

zungeru commented 8 years ago

Thanks, doomsy! Worked for me as well

rsa408 commented 8 years ago

Thanks, doomsy! Worked for me as well

emalherbi-zz commented 8 years ago

:+1:

chy600 commented 8 years ago

Thank you doomsy! Saved my day.

vincelooft commented 8 years ago

Thanks!

mategvo commented 8 years ago

Thank you!

hitendradeveloper commented 8 years ago

Thanks to doomsy. Help me a lot

raul1991 commented 8 years ago

Works great thanks @doomsy

zachstronaut commented 8 years ago

This is helpful, and does work, but you know... crazy idea... maybe somebody could update the actual DOCS with this fact, so a thousand people don't separately have to google this ticket.

shazron commented 8 years ago

Maybe you should actually see that the docs have this before making this assertion? Hint: it does

zachstronaut commented 8 years ago

hahaha

Fair enough, the docs for ios-deploy indeed do mention it... it would be nice if the cordova docs did, too. https://cordova.apache.org/docs/en/5.4.0/guide/platforms/ios/

shazron commented 8 years ago

Added https://github.com/phonegap/ios-deploy/commit/8757ca562f354cdf9b8c2e64d6bb9f9963064c76

zachstronaut commented 8 years ago

You are officially my hero. Thank you.

tashavanes commented 8 years ago

just helped me too, thanks!

raisudeen commented 8 years ago

Tons of Thanks @doomsy

MacrofonoEstudio commented 8 years ago

Thanks : ) @doomsy: sudo npm install --global --unsafe-perm ios-deploy did the trick

refaelgold commented 8 years ago

Thanks - that what i needed

robin12345 commented 8 years ago

@doomsy Thanks Man!

everbgs commented 8 years ago

@doomsy Thanks a bunch Man!!

calevano commented 8 years ago

@doomsy Thanks.

HaiyuanZh commented 8 years ago

Thanks @doomsy ,it works

iamezell commented 8 years ago

Thanks @doomsy

thiago-slb commented 8 years ago

Thanks @doomsy Saved my day!

ndleon09 commented 8 years ago

Thanks @doomsy

vuhung3990 commented 8 years ago

thank you @doomsir

bar3bon3 commented 8 years ago

Thanks @doomsy!

limiterCore commented 8 years ago

Thank you, huh. It looks bad, if too many people get this error...

mirwaqaskhan commented 8 years ago

Works like a charm. Thanks @doomsy Saved my day!

amidani-jahia commented 8 years ago

Works fine Thx

ghost commented 8 years ago

Hey @doomsy, I guess I'm really unlucky today. Still getting the following error after sudo npm install --global --unsafe-perm ios-deploy. I'm running on Mac 10.9.5 and don't have Xcode installed yet. It's probably 'cause of that. I'm not sure.

|
> ios-deploy@1.8.6 preinstall /usr/local/lib/node_modules/ios-deploy
> ./src/scripts/check_reqs.js && xcodebuild

stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

npm ERR! Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "--unsafe-perm" "ios-deploy"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE

npm ERR! ios-deploy@1.8.6 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ios-deploy@1.8.6 preinstall script './src/scripts/check_reqs.js && xcodebuild'.
npm ERR! This is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./src/scripts/check_reqs.js && xcodebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ios-deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/sunandasamaddar/npm-debug.log
ArshanKhanifar commented 7 years ago

thanks @doomsy ! you're a lifesaver!

ghost commented 7 years ago

@SunandoSamaddar

Yes, you need XCode installed first. I ran into this just today. On your Mac: App Store

Top right, search for "Xcode".. and install.

Good luck

danjirawat commented 7 years ago

Thank you very much.

Saporules commented 7 years ago

after using @doomsy 's sudo npm install --global --unsafe-perm ios-deploy Everything looks fine:

** BUILD SUCCEEDED **

/Users/Saporules/.npm-packages/bin/ios-deploy -> /Users/Saporules/.npm-packages/lib/node_modules/ios-deploy/build/Release/ios-deploy
/Users/Saporules/.npm-packages/lib
└── ios-deploy@1.8.6 

But after that I check with $ ionic info it throws the following:

Your system information:

Cordova CLI: 6.2.0
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
ios-deploy version: Not installed
ios-sim version: 5.0.6 
OS: Mac OS X El Capitan
Node Version: v5.5.0
Xcode version: Xcode 7.3.1 Build version 7D1014 

******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly recommended to install/upgrade the following:     

 Install ios-deploy to deploy iOS applications to devices. `npm install -g ios-deploy` (may require sudo)

******************************************************

:( any Idea why?

asetyde commented 7 years ago

Please update cordova guide !

shazron commented 7 years ago

That seems to be an ionic command output - please contact them to update.

shazron commented 7 years ago

See https://github.com/driftyco/ionic-app-lib/blob/9da64e94941404c9c72f06511a009cf84e4c700c/lib/info.js#L342

neufeng commented 7 years ago

@doomsy So cool! Works for me! Thank you very much!

erdemildiz commented 7 years ago

Thanks @doomsy

mashek347 commented 7 years ago

is not working for me