I am a student and I just started with ionic today. I have no experience with command line usage so I am pretty stumped here.
When I try to run the basic template (tabs) with:
sudo ionic platform add ios sudo ionic build ios sudo ionic emulate ios
(these don't work without having the sudo there). the last one produces this in the logs (among other stuff above):
** BUILD SUCCEEDED ** No target specified for emulator. Deploying to iPhone-6 simulator An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159): Invalid device state An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159): Invalid device state ENOENT: no such file or directory, stat '/Users/Dylan/Library/Logs/CoreSimulator/D0923A6C-7738-41BA-8134-ED747069991A/system.log' Error code 1 for command: ios-sim with args: launch,/Users/Dylan/myApp/platforms/ios/build/emulator/myApp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/Dylan/myApp/platforms/ios/cordova/console.log,--stdout,/Users/Dylan/myApp/platforms/ios/cordova/console.log,--exit Error: /Users/Dylan/myApp/platforms/ios/cordova/run: Command failed with exit code 2
I have seen a few unsolved posts with the same errors but they haven't gotten anywhere. It could possibly be related to these following things here:
sudo npm install -g cordova ionic I get this warning:
npm WARN deprecated email@example.com: this package has been reintegrated into npm and is now out of date with respect to npm
Also, afterwards, if I try to run
ionic I get a
-bash: ionic: command not found error, but if I run
sudo ionic then it logs a whole bunch of stuff to the console. Could this one be an error with security changes in El Capitan?
Thanks for your help in advance.Answer1:
To prevent having to <strong>sudo</strong> almost anything you do in <strong>npm</strong> while working on MAC, my best advice is:
<strong>Install npm through <a href="https://www.npmjs.com/package/nvm" rel="nofollow">Node Version Manager</a></strong>.