Ionic install issue osx


#1
Bens-MacBook-Air:~ benraboine$ sudo npm install -g ionic

> v8flags@1.0.5 install /usr/local/lib/node_modules/ionic/node_modules/gulp/node_modules/v8flags
> node fetch.js

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
-
node.js:815
    var cwd = process.cwd();
                      ^
Error: EACCES, permission denied
    at Function.startup.resolveArgv0 (node.js:815:23)
    at startup (node.js:58:13)
    at node.js:906:3
npm ERR! v8flags@1.0.5 install: `node fetch.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the v8flags@1.0.5 install script.
npm ERR! This is most likely a problem with the v8flags package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node fetch.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls v8flags
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "ionic"
npm ERR! cwd /Users/benraboine
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

#2

Thanks for bringing this up, we’re looking into it


#3

Thanks, I look forward to a resolution so I can start using Ionic!


#4

@raboine - we’ve pushed a new version. Please try that out and let us know if that fixes it!


#5

Works perfectly now, thanks!


#6

I have iOS Simulator 8.1 (550.3) but the emulate isn’t working properly. Any idea what I’m doing worg here? Thanks, Ben

Bens-MacBook-Air:myApp benraboine$ sudo ionic emulate ios
Running command: /Users/benraboine/myApp/hooks/after_prepare/010_add_platform_class.js /Users/benraboine/myApp
add to body class: platform-ios
Running command: /Users/benraboine/myApp/platforms/ios/cordova/run --emulator
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/benraboine/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
SHARED_PRECOMPS_DIR = /Users/benraboine/myApp/platforms/ios/build/sharedpch
VALID_ARCHS = i386

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET myApp OF PROJECT myApp WITH CONFIGURATION Debug ===

Check dependencies

PhaseScriptExecution Copy\ www\ directory build/myApp.build/Debug-iphonesimulator/myApp.build/Script-304B58A110DAC018002A0835.sh
cd /Users/benraboine/myApp/platforms/ios
/bin/sh -c /Users/benraboine/myApp/platforms/ios/build/myApp.build/Debug-iphonesimulator/myApp.build/Script-304B58A110DAC018002A0835.sh

real 0m0.217s
user 0m0.085s
sys 0m0.130s

ProcessInfoPlistFile build/emulator/myApp.app/Info.plist myApp/myApp-Info.plist
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-infoPlistUtility /Users/benraboine/myApp/platforms/ios/myApp/myApp-Info.plist -genpkginfo /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -additionalcontentfile /Users/benraboine/myApp/platforms/ios/build/myApp.build/Debug-iphonesimulator/myApp.build/MainViewController-PartialInfo.plist -o /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/Info.plist

GenerateDSYMFile build/emulator/myApp.app.dSYM build/emulator/myApp.app/myApp
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/myApp -o /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app.dSYM

Touch build/emulator/myApp.app
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/touch -c /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app

** BUILD SUCCEEDED **

2014-12-11 16:58:32.139 ios-sim[61612:9027763] stderrPath: /Users/benraboine/myApp/platforms/ios/cordova/console.log
2014-12-11 16:58:32.140 ios-sim[61612:9027763] stdoutPath: /Users/benraboine/myApp/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Simulator session timed out.” UserInfo=0x7f8f7ac26540 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/benraboine/myApp/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)


#7

Do you have xcode 6.0 or higher? Do you also have ios-sim?
I’ve had this happen to me before as well, easy way to fix it is to have the simulator started before you emulate.


#8

Xcode Version 6.1.1 (6A2008a). Is ios-sim just the simulator? If not, can you please send me a link? I am able to launch my regular Xcode project in the simulator. But even when I run that before I run sudo ionic emulate ios, nothing is simulated. The output is below, not sure if it is the same as what I sent before. Thanks, Ben

Bens-MacBook-Air:myApp benraboine$ sudo ionic emulate ios
Password:
Running command: /Users/benraboine/myApp/hooks/after_prepare/010_add_platform_class.js /Users/benraboine/myApp
add to body class: platform-ios
Running command: /Users/benraboine/myApp/platforms/ios/cordova/run --emulator
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/benraboine/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator8.1
SHARED_PRECOMPS_DIR = /Users/benraboine/myApp/platforms/ios/build/sharedpch
VALID_ARCHS = i386

=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET myApp OF PROJECT myApp WITH CONFIGURATION Debug ===

Check dependencies

PhaseScriptExecution Copy\ www\ directory build/myApp.build/Debug-iphonesimulator/myApp.build/Script-304B58A110DAC018002A0835.sh
cd /Users/benraboine/myApp/platforms/ios
/bin/sh -c /Users/benraboine/myApp/platforms/ios/build/myApp.build/Debug-iphonesimulator/myApp.build/Script-304B58A110DAC018002A0835.sh

real 0m0.273s
user 0m0.095s
sys 0m0.160s

ProcessInfoPlistFile build/emulator/myApp.app/Info.plist myApp/myApp-Info.plist
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-infoPlistUtility /Users/benraboine/myApp/platforms/ios/myApp/myApp-Info.plist -genpkginfo /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -additionalcontentfile /Users/benraboine/myApp/platforms/ios/build/myApp.build/Debug-iphonesimulator/myApp.build/MainViewController-PartialInfo.plist -o /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/Info.plist

GenerateDSYMFile build/emulator/myApp.app.dSYM build/emulator/myApp.app/myApp
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app/myApp -o /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app.dSYM

Touch build/emulator/myApp.app
cd /Users/benraboine/myApp/platforms/ios
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/touch -c /Users/benraboine/myApp/platforms/ios/build/emulator/myApp.app

** BUILD SUCCEEDED **

2014-12-12 12:36:14.682 ios-sim[13961:9365512] stderrPath: /Users/benraboine/myApp/platforms/ios/cordova/console.log
2014-12-12 12:36:14.683 ios-sim[13961:9365512] stdoutPath: /Users/benraboine/myApp/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Simulator session timed out.” UserInfo=0x7fd158789fc0 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/benraboine/myApp/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)


#9

No, ios-sim is a phonegap utility to launch the simulator from the command line


#10

Thanks for the link! I tried to follow the Installation:
$ npm install ios-sim -g
$ curl -L https://github.com/phonegap/ios-sim/zipball/3.1.1 -o ios-sim-3.1.1.zip
$ unzip ios-sim-3.1.1.zip
$ rake install prefix=/usr/local/
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)


#11

Hmm, I just ran sudo npm install ios-sim -g on my mac and it installed with out a problem.

So a few things to ask first. Do you have the xcode command line tool installed? You should be able to install it from Preferenced>Downloads.

Not sure what else could be causing the issues though.


#12

Yep.
Bens-MacBook-Air:~ benraboine$ xcode-select --install
xcode-select: error: command line tools are already installed, use “Software Update” to install updates

Bens-MacBook-Air:myApp benraboine$ sudo npm install ios-sim -g
/

ios-sim@3.1.1 preinstall /usr/local/lib/node_modules/ios-sim
rake build

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:50:in pwd': Permission denied - getcwd (Errno::EACCES) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:50:ininitialize’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/rake_module.rb:10:in new' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/rake_module.rb:10:inapplication’
from /usr/bin/rake:37:in `’

npm ERR! ios-sim@3.1.1 preinstall: rake build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ios-sim@3.1.1 preinstall script.
npm ERR! This is most likely a problem with the ios-sim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rake build
npm ERR! You can get their info via:
npm ERR! npm owner ls ios-sim
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command “node” “/usr/local/bin/npm” “install” “ios-sim” "-g"
npm ERR! cwd /Users/benraboine/myApp
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0


#13

Can you try this?

$ DevToolsSecurity -enable

or

$ sudo DevToolsSecurity -enable

Seems to be a permissions issues, but I’m not really sure why


#14

Do you have rvm installed?

Also, can you run rake --help?

I’m trying to figure out if you can access rake and ruby utils or its failing to have permissions to access those directories.


#15

Bens-MacBook-Air:myApp benraboine$ sudo DevToolsSecurity -enable
Password:
Developer mode is already enabled.

Bens-MacBook-Air:myApp benraboine$ rake --help
rake [-f rakefile] {options} targets…

Options are …
–backtrace=[OUT] Enable full backtrace. OUT can be stderr (default) or stdout.
–comments Show commented tasks only
–job-stats [LEVEL] Display job statistics. LEVEL=history displays a complete job list
–reduce-compat Remove DSL in Object; remove Module#const_missing which defines ::Task etc.
–rules Trace the rules resolution.
–suppress-backtrace PATTERN Suppress backtrace lines matching regexp PATTERN. Ignored if --trace is on.
-A, --all Show all tasks, even uncommented ones
-C, --classic-namespace Put Task and FileTask in the top level namespace
-D, --describe [PATTERN] Describe the tasks (matching optional PATTERN), then exit.
-e, --execute CODE Execute some Ruby code and exit.
-E, --execute-continue CODE Execute some Ruby code, then continue with normal task processing.
-f, --rakefile [FILE] Use FILE as the rakefile.
-G, --no-system, --nosystem Use standard project Rakefile search paths, ignore system wide rakefiles.
-g, --system Using system wide (global) rakefiles (usually ‘~/.rake/*.rake’).
-I, --libdir LIBDIR Include LIBDIR in the search path for required modules.
-j, --jobs [NUMBER] Specifies the maximum number of tasks to execute in parallel. (default:2)
-m, --multitask Treat all tasks as multitasks.
-n, --dry-run Do a dry run without executing actions.
-N, --no-search, --nosearch Do not search parent directories for the Rakefile.
-P, --prereqs Display the tasks and dependencies, then exit.
-p, --execute-print CODE Execute some Ruby code, print the result, then exit.
-q, --quiet Do not log messages to standard output.
-r, --require MODULE Require MODULE before executing rakefile.
-R, --rakelibdir RAKELIBDIR, Auto-import any .rake files in RAKELIBDIR. (default is ‘rakelib’)
–rakelib
-s, --silent Like --quiet, but also suppresses the ‘in directory’ announcement.
-t, --trace=[OUT] Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout.
-T, --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit.
-v, --verbose Log message to standard output.
-V, --version Display the program version.
-W, --where [PATTERN] Describe the tasks (matching optional PATTERN), then exit.
-X, --no-deprecation-warnings Disable the deprecation warnings.
-h, -H, --help Display this help message.


#16

I’m really excited to get started on this app. Any chance I can just stop by the office tomorrow with my laptop? Thanks, Ben


#17

Nevermind, I am able to run it okay if I emulate the project from Xcode! Thanks for all your help with the previous issues.


#18

raboine – are there any particular steps u can share about how you were able to get it working via running xCode first. I am unable to replicate this general step of running the Simulator through xCode first. Thanks. -Albert


#19

I don’t recall because I never got it to work in command line, and it just worked when I tried it in xCode. I now use the browser testing with “ionic serve” then when I’m doing my final testing I use Ionic View on the actual device. Hope this helps!


#20

I know it’s an old issue, but it’s still ranking high on google.

TLDR: Run the following:

sudo chown -R $USER /usr/local/

If you’ve used sudo to install npm you’ll run into this problem. Here’s the issue from github: https://github.com/npm/npm/issues/194