Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
guiix-code opened this issue Mar 18, 2015 · 109 comments
Closed

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

guiix-code opened this issue Mar 18, 2015 · 109 comments

Comments

@guiix-code
Copy link

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
Copy link

shazron commented Mar 25, 2015

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
Copy link
Author

Other npm modules install globally fine, yes.

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

@shazron
Copy link

shazron commented Apr 4, 2015

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
Copy link
Author

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

@guiix-code
Copy link
Author

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
Copy link
Author

Fix found:

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

@shazron shazron closed this as completed Apr 18, 2015
@caroso1222
Copy link

Thanks doomsy. This did the trick for me

@aotian16
Copy link

Thanks to doomsy. Help me a lot

@EricGlaenzer
Copy link

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

@travisbmiller
Copy link

worked for me as well! Thank you

@zungeru
Copy link

zungeru commented Jan 2, 2016

Thanks, doomsy! Worked for me as well

1 similar comment
@rsa408
Copy link

rsa408 commented Jan 2, 2016

Thanks, doomsy! Worked for me as well

@emalherbi-zz
Copy link

👍

@chy600
Copy link

chy600 commented Jan 21, 2016

Thank you doomsy! Saved my day.

@vincelooft
Copy link

Thanks!

@mategvo
Copy link

mategvo commented Jan 25, 2016

Thank you!

@hitendradeveloper
Copy link

Thanks to doomsy. Help me a lot

@raul1991
Copy link

raul1991 commented Feb 4, 2016

Works great thanks @doomsy

@zachstronaut
Copy link

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
Copy link

shazron commented Feb 4, 2016

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

@zachstronaut
Copy link

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
Copy link

shazron commented Feb 4, 2016

Added 8757ca5

@zachstronaut
Copy link

You are officially my hero. Thank you.

@tashavanes
Copy link

just helped me too, thanks!

@raisudeen
Copy link

Tons of Thanks @doomsy

@MacrofonoEstudio
Copy link

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

@refaelgold
Copy link

Thanks - that what i needed

@robin12345
Copy link

@doomsy Thanks Man!

@everbgs
Copy link

everbgs commented Mar 9, 2016

@doomsy Thanks a bunch Man!!

@vinigg2
Copy link

vinigg2 commented Dec 27, 2017

Thanks @doomsy

1 similar comment
@kalaimathiB
Copy link

Thanks @doomsy

@BenFransen
Copy link

Keep in mind if you freshly installed Xcode to follow-up on @brunobc182 reaction to pick a command line tools item in Xcode preferences. After that I still got an error, but it was also telling me to add --unsafe-perm=true. After that all was fine. (so thanks @doomsy as well)

@4i-helpynet
Copy link

After we added command line tools and install with sudo npm install --global --unsafe-perm ios-deploy
Still got this error :(
iOS 10.12.6 Sierra

@RobertPinson
Copy link

RobertPinson commented Feb 1, 2018

Me too iOS 10.13.2 High Sierra

Got Cordova iOS platform to build after following @Zwilla comment.

@sKuD51
Copy link

sKuD51 commented Feb 1, 2018

@doomsy big # thanks, it works !!!

@dancsdavid
Copy link

We get this error:

** BUILD SUCCEEDED **

/Users/macmini/.npm-global/bin/ios-deploy -> /Users/macmini/.npm-global/lib/node_modules/ios-deploy/build/Release/ios-deploy

  • ios-deploy@1.9.2
    updated 1 package in 8.358s
    MacMinis-Mac-mini: macmini$ cordova requirements

Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: not installed
ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'
CocoaPods: installed [object Object]
(node:11685) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Some of requirements check failed
(node:11685) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

We definetly installed it with a command before and it was success...

@marchpanda123
Copy link

thanks to doomsy

@tousif03raza
Copy link

@doomsy Thanks, it worked!

@himalayaahuja
Copy link

himalayaahuja commented Apr 13, 2018

Tried both solutions as recommended by @doomsy and @mefm247 But still it says:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

Something to do with path? The package gets installed successfully though.
/Users//.npm-global/bin/ios-deploy -> /Users//.npm-global/lib/node_modules/ios-deploy/build/Release/ios-deploy

  • ios-deploy@1.9.2
    updated 1 package in 16.019s

@pabloca88
Copy link

@doomsy you're the boss!! saved me hs and hs of search

@yonastefera
Copy link

Thanks @doomsy you saved the day, cheers!!!

@helpynet
Copy link

If any of this methods not working like @dancsdavid mentioned, make a new user from ground on Mac. Then install everything on this new user.

@yonastefera
Copy link

yonastefera commented May 28, 2018 via email

@parveencse
Copy link

Thanks doomsy. nice !!!!!! It is working

@zachonahill
Copy link

Thanks @brunobc182 !! I didn't have my XCode command line tools set!

@eddroid
Copy link

eddroid commented Jul 17, 2018

brew install ios-deploy worked for me if you have Homebrew on Mac.

@GreenRidingHood
Copy link

@doomsy works like charm, thanks

@Khaledalien
Copy link

@doomsy Thank you so much, you saved my day

@nitishbhardwaj1111
Copy link

@doomsy it worked for me,
saved my day
thanks

@CodeLtDave
Copy link

@doomsy I love you. I spend so much time on trying to solve this problem.

@nitishbhardwaj1111
Copy link

@doomsy. It worked for me too.
Thanks man.

@salmanullahkhan15
Copy link

@doomsy You are the man.

@pystar1007
Copy link

@doomsy
Thanks for your exact leadership.

@kumarutsav111
Copy link

Thanks @doomsy , this worked for me too

@DeyiXu
Copy link

DeyiXu commented Jun 10, 2019

Thanks @doomsy

@santhoniral
Copy link

npm install npm@latest -g

@drm-code
Copy link

brew install ios-deploy worked for me if you have Homebrew on Mac.

You're the man dude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests