2016-07-07 130 views
0

我正在嘗試按照官方'Getting Started'Ionic2文檔的安裝部分中給出的說明設置Ionic2環境。iOs2構建iOs失敗

我在裝有El Captain 10.11.5版和最新的xCode版本(7.3.1)的Mac上。

在安裝Cordova之後,我已經成功執行了命令ionic platform add ios

當我運行下一個命令ionic emulate ios(作爲入門指南中提到的),我得到一個神祕的錯誤,其日誌

(node:38155) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 

Running 'emulate:before' gulp task before emulate 
[18:17:00] Starting 'clean'... 
[18:17:00] Finished 'clean' after 45 ms 
[18:17:00] Starting 'build'... 
[18:17:00] Starting 'sass'... 
[18:17:00] Starting 'html'... 
[18:17:00] Starting 'fonts'... 
[18:17:00] Starting 'scripts'... 
[18:17:00] Finished 'html' after 80 ms 
[18:17:00] Finished 'scripts' after 78 ms 
[18:17:00] Finished 'fonts' after 88 ms 
[18:17:01] Finished 'sass' after 901 ms 
[18:17:07] Finished 'build' after 6.73 s 
[18:17:07] Starting 'emulate:before'... 
[18:17:07] Finished 'emulate:before' after 4.22 μs 


You have been opted out of telemetry. To change this, run: cordova telemetry on. 

Running command: /Users/enrico.piccinin/work/dbs/examples/ionic2/cutePuppyPics/hooks/after_prepare/010_add_platform_class.js /Users/enrico.piccinin/work/dbs/examples/ionic2/cutePuppyPics 


add to body class: platform-ios 

Error: 


Caught exception: 
undefined 

然後我上網了一下,找到一個建議,運行以下命令npm install -g ios-deploy --unsafe-perm=true但一旦我這樣做,這就是我所獲得的

> [email protected] preinstall /usr/local/lib/node_modules/.staging/ios-deploy-298c9491 
> ./src/scripts/check_reqs.js && xcodebuild 

/usr/local/lib/node_modules/.staging/ios-deploy-298c9491/src/scripts/check_reqs.js:29 
     var ver = arr[1]; 
        ^

TypeError: Cannot read property '1' of null 
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/.staging/ios-deploy-298c9491/src/scripts/check_reqs.js:29:16) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at maybeClose (internal/child_process.js:852:16) 
    at Socket.<anonymous> (internal/child_process.js:323:11) 
    at emitOne (events.js:96:13) 
    at Socket.emit (events.js:188:7) 
    at Pipe._handle.close [as _onclose] (net.js:492:12) 
npm ERR! Darwin 15.5.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy" "--unsafe-perm=true" 
npm ERR! node v6.3.0 
npm ERR! npm v3.10.3 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] preinstall: `./src/scripts/check_reqs.js && xcodebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script './src/scripts/check_reqs.js && xcodebuild'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ios-deploy package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ./src/scripts/check_reqs.js && xcodebuild 

順便說一句,建設爲Android在同一臺機器上工作正常。

任何想法可能是錯的?

非常感謝您提供任何幫助

回答

0

您是否嘗試從XCode運行項目? 在mac上,當我想運行應用程序時,我從終端運行:ionic build ios,之後,我從XCode運行項目。一切工作正常