在macOs Sierra上僅由離子安裝的新項目(遵循離子站點的說明)。當我嘗試運行ionic serve
它失敗,此錯誤:ionic serve無法讀取未定義的屬性'hasOwnProperty'(CLI v2.1.7)
TypeError: Cannot read property 'hasOwnProperty' of undefined
at Object.runr (/usr/local/lib/node_modules/ionic/lib/cli.js:191:19)
at /usr/local/lib/node_modules/ionic/lib/cli.js:54:9
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:419:9)
at process._tickCallback (node.js:348:13)
Cannot read property 'hasOwnProperty' of undefined (CLI v2.1.7)
Your system information:
Cordova CLI: 5.4.1
Ionic CLI Version: 2.1.7
Ionic App Lib Version: 2.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v4.2.4
Xcode version: Xcode 8.0 Build version 8A218a
我已經卸載和重新安裝離子,但仍然得到同樣的錯誤。 使用OS-X 10.9時我沒有遇到任何問題。
同樣在這裏。它正在工作,然後我做了一個'npm install -g ionic'並停止了;也許我們應該使用1.2.4版本(在npm下穩定)。 做'npm install -g ionic @ 1.2.4' –