iOS上的离子构建和模拟 - 错误 [英] Ionic build and emulate on iOS - error

查看:185
本文介绍了iOS上的离子构建和模拟 - 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常高兴我在Ionic框架上看到的一切,一个孩子发现了一个球,他是他。



但是,我面对一些工具配置问题:



使用Xcode 7.2.1和Yosemite在我的Mac上安装Apache Cordova 6.2.0;



安装了Ionic 1.7.15客户端;节点4.4.5和NPM 3.9.3;



我设法创建一个应用程序,打开Ionic和Ionic实验室视图,没有问题。



但是当我尝试安装组件以在xCode中构建时,会出现一些问题:



a)ios-yes - / p>

b)ios-deploy - 各种错误讯息:

  Npm WARN生命周期ios-deploy@1.8.6~preinstall:无法在wd%s%s(%s = wd)中运行ios-deploy@1.8.6 ./src/scripts/check_reqs.js xcodebuild&& / usr / local /lib/node_modules/.staging/ios-deploy-298c9491 
npm ERR!达尔文14.5.0
npm错误! argv/ usr / local / bin / node/ usr / local / bin / npminstall-gios-deploy
npm ERR! node v4.4.5
npm ERR! npm v3.9.3
npm ERR!路径/ usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy
npm ERR!代码ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! ENOENT ENOENT:没有这样的文件或目录chmod'/ usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy'
npm ERR! ENOENT ENOENT:没有这样的文件或目录chmod'/ usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy'
npm ERR! ENOENT这很可能不是npm本身的问题
npm ERR! ENOENT并与npm无法找到该文件相关。
npm ERR! ENOENT

npm错误!请包括任何支持请求的以下文件:
npm ERR! /Users/myuser/npm-debug.log

我在执行命令时遇到问题:



1)$ ionic platform add ios:

 有执行权限
下载默认Ionic资源
下载:https://github.com/driftyco/ionic-default-resources/archive/master.zip
[======= ======================] 100%0.0s
完成添加默认离子资源
为平台添加图标:ios
/usr/local/lib/node_modules/cordova/node_modules/configstore/index.js:53
throw err;
^

错误:EACCES:权限被拒绝,打开'/Users/myuser/.config/configstore/insight-cordova.json'
您无权访问此文件。

at Error(native)
在Object.fs.openSync(fs.js:549:18)
在Object.fs.readFileSync(fs.js:397:15 )
在Object.create.all.get(/usr/local/lib/node_modules/cordova/node_modules/configstore/index.js:34:26)
在Object.Configstore(/ usr / local /lib/node_modules/cordova/node_modules/configstore/index.js:27:44)
在新Insight(/usr/local/lib/node_modules/cordova/node_modules/insight/lib/index.js:38: 34)
at Object。 < anonymous> (/usr/local/lib/node_modules/cordova/src/telemetry.js:37:15)
在Module._compile(module.js:409:26)
在Object.Module._extensions。 .js(module.js:416:10)
at Module.load(module.js:343:32)
我无法使用命令$ ionic build ios sudo ionic build ios



最后,命令sudo $ ionic emulate ios打开模拟器,显示项目...



感谢任何人有任何方向...



p>

Jan Ferrer

解决方案

对不起,我不知道这是否评论。



sudo 您安装cordova,离子等等。 ?



这可能是因为权限问题而导致的,并且会阻止成功安装某些模块或访问Mac中的某些文件夹。



您可以对文件夹执行 chmod 更改权限设置,但我不推荐快速修复。



我在Mac上也有类似的问题,经过几个小时的努力,我终于做了一个全新的安装 node using npm brew ,以避免在使用 npm



这是一个痛苦的安装新鲜,特别是因为你需要干净地删除当前节点安装,但它会避免解决权限错误



卸载/安装节点: http://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/



如果您选择接受此建议,请更新下一步会发生什么。


I am very happy with everything I've seen so far on the Ionic framework, a child who finds a ball to play, he he.

However, I'm facing some tool configuration problems:

Installed Apache Cordova 6.2.0 on my Mac with Xcode 7.2.1 and Yosemite;

Installed Ionic 1.7.15 client; Node 4.4.5 and NPM 3.9.3;

I managed to create an app, open the Ionic and Ionic Lab View, no problem.

But when I try to install the components to build in xCode, there were some problems:

a) ios-yes - no problem

b) ios-deploy - various error messages:

Npm WARN lifecycle ios-deploy@1.8.6~preinstall: can not run in wd% s% s (% s = wd) ios-deploy@1.8.6 ./src/scripts/check_reqs.js xcodebuild && / usr / local /lib/node_modules/.staging/ios-deploy-298c9491
npm ERR! Darwin 14.5.0
npm ERR! argv "/ usr / local / bin / node" "/ usr / local / bin / npm" "install" "-g" "ios-deploy"
npm ERR! node v4.4.5
npm ERR! npm v3.9.3
npm ERR! path / usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! ENOENT ENOENT: no such file or directory chmod '/ usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy'
npm ERR! ENOENT ENOENT: no such file or directory chmod '/ usr / local / lib / node_modules / ios-deploy / build / Release / ios-deploy'
npm ERR! ENOENT This is Most Likely not a problem with npm itself
npm ERR! ENOENT and is related to npm not being able to find the file.
npm ERR! ENOENT

npm ERR! Please include The Following file with any support request:
npm ERR! /Users/myuser/npm-debug.log

I had problems in the execution of commands:

1) $ ionic platform add ios:

Updated the hooks directory to have execute permissions
Downloading Default Ionic Resources
Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip
[=============================] 100% 0.0s
Done adding default Ionic resources
Adding icons for platform: ios
/usr/local/lib/node_modules/cordova/node_modules/configstore/index.js:53
throw err;
^

Error: EACCES: permission denied, open '/Users/myuser/.config/configstore/insight-cordova.json'
You do not have access to this file.

at Error (native)
at Object.fs.openSync (fs.js: 549: 18)
at Object.fs.readFileSync (fs.js: 397: 15)
at Object.create.all.get (/usr/local/lib/node_modules/cordova/node_modules/configstore/index.js:34:26)
at Object.Configstore (/usr/local/lib/node_modules/cordova/node_modules/configstore/index.js:27:44)
at new Insight (/usr/local/lib/node_modules/cordova/node_modules/insight/lib/index.js:38:34)
at Object. <anonymous> (/usr/local/lib/node_modules/cordova/src/telemetry.js:37:15)
at Module._compile (module.js: 409: 26)
at Object.Module._extensions..js (module.js: 416: 10)
at Module.load (module.js: 343: 32) "
I can not compile with the command "$ ionic build ios" using only "$ sudo ionic build ios

Finally, the command "sudo $ ionic emulate ios" opens the simulator but does not show the project ...

I appreciate if anyone has any direction ...

Thanks.

Jan Ferrer

解决方案

Sorry, I am not sure whether this is a comment. I don't have enough points to do so.

Did you install cordova, ionic, etc. with sudo?

This may be happening because of permission problems, and it prevents installing some modules successfully or accessing certain folders in your Mac.

You could do chmod on your folder to change the permission settings, but I don't really recommend that quick fix.

I have also had a similar problem before on Mac, and after hours of trying to get around it, I finally did a fresh install of node using nvm or brew to avoid using sudo again and again when installing modules via npm.

It's a bit of a pain installing fresh, especially since you would need to cleanly remove your current node installation, but it will save you from solving permission errors, using sudo, etc. in the long run.

uninstall/installing node: http://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/

If ever you opt to go through this suggestion, please do update what happens next.

这篇关于iOS上的离子构建和模拟 - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆