我是一名学生,今天我刚刚开始使用离子。我没有使用命令行的经验,所以我在这里很难过。
当我尝试使用:
运行基本模板(标签)时sudo ionic platform add ios
sudo ionic build ios
sudo ionic emulate ios
(这些没有sudo在那里工作)。 最后一个在日志中产生这个(以及其他内容):
** 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
我看到一些未解决的帖子有相同的错误,但他们还没有到达任何地方。它可能与以下这些事情有关:
运行sudo npm install -g cordova ionic
时,我收到此警告:
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
此外,如果我尝试运行ionic
,我会收到-bash: ionic: command not found
错误,但如果我运行sudo ionic
,那么它会将一大堆内容记录到控制台。这可能是El Capitan安全性变化的错误吗?
提前感谢您的帮助。