簡體   English   中英

Ionic在iOS上構建和仿真-錯誤

[英]Ionic build and emulate on iOS - error

到目前為止,我對在Ionic框架上看到的一切感到非常滿意,他是一個找到球的孩子。

但是,我面臨一些工具配置問題:

在Mac上使用Xcode 7.2.1和Yosemite安裝了Apache Cordova 6.2.0;

已安裝Ionic 1.7.15客戶端; 節點4.4.5和NPM 3.9.3;

我設法創建了一個應用程序,打開了Ionic和Ionic Lab視圖,沒問題。

但是,當我嘗試安裝要在xCode中構建的組件時,出現了一些問題:

a)ios-是的-沒問題

b)ios部署-各種錯誤消息:

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

我在執行命令時遇到問題:

1)$ ionic平台添加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

最后,命令“ sudo $ ionic emulation ios”打開模擬器,但不顯示項目。

如果有人指示我,我將不勝感激。

謝謝。

揚·費雷爾

抱歉,我不確定這是否是評論。 我的積分不足。

您是否在sudo安裝了cordova,ionic等產品?

這可能是由於權限問題而發生的,它阻止了成功安裝某些模塊或訪問Mac中的某些文件夾。

您可以在文件夾上執行chmod來更改權限設置,但我不建議您快速修復該問題。

在Mac上之前,我也遇到過類似的問題,經過數小時的嘗試,我終於使用nvmbrew重新安裝了node以避免在通過npm安裝模塊時一次又一次地使用sudo。

重新安裝有點麻煩,特別是因為您需要徹底刪除當前的節點安裝,但從長遠來看,它將避免解決權限錯誤,使用sudo等問題。

卸載/安裝節點: http : //stackabuse.com/how-to-uninstall-node-js-from-mac-osx/

如果您選擇通過此建議,請務必更新下一步。

問題解決了。

總而言之,我不得不卸載Apache Cordova IONIC,不得不返回NODE版本6.2.0至4.4.5和NPM 3.8.9至2.15.1; 然后重新安裝。

我必須在OSx終端中使用CHMOD命令提供所有在錯誤消息中收費的權限文件和文件夾。

因此,一切工作令人滿意。

我也遇到了這個問題,並在對此問題的評論中找到了解決方案。 您可以使用

須藤npm install -g ios-deploy --unsafe-perm = true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM