新来离子 – 不能build立在埃尔卡皮坦的IOS(9),sudo离子是必需的,不推荐使用npmconf
我是一名学生,今天刚从离子开始。 我没有使用命令行的经验,所以我很难在这里。
当我尝试运行基本模板(标签)时:
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
我曾经看过一些没有解决的post,但是没有得到任何答案。 这可能与以下这些事情有关:
当运行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
那么它会logging一大堆东西到控制台。 难道这是El Capitan的安全性变化吗?
感谢您的帮助提前。
为了防止在使用MAC时几乎所有你在npm上做的事情,我最好的build议是:
通过节点版本pipe理器安装npm 。