2017-02-09 10 views
3

ionic2 hello worldが動作しません。 http://localhost:8100/ionic2が実行中のdevサーバ(ion hello world)へのアドレス指定に失敗しました

私はこのURLを解決しようとすると、私はこのエラーを取得:

のdevのサーバーを実行 - https://ionicframework.com/docs/v2/intro/tutorial/

install cordova and ionic 
ionic start probaionic --v2 
cd probaionic 
ionic serve 

すべてが正常に動作している -

私は公式サイトを始める次のい

traineeProgram/probaionic/node_modules/@ionic/app-scripts/dist/dev-server  /live-reload.js:27 
var contentStr = content.toString(); 
         ^

TypeError: Cannot read property 'toString' of undefined 
at Object.injectLiveReloadScript (/media/volodymyr/Media/[[1]] work/[8]programming/[1]keenethics/traineeProgram/probaionic/node_modules/@ionic/app-scripts/dist/dev-server/live-reload.js:27:29) 
at ReadFileContext.callback (/media/volodymyr/Media/[[1]] work/[8]programming/[1]keenethics/traineeProgram/probaionic/node_modules/@ionic/app-scripts/dist/dev-server/http-server.js:62:39) 
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13) 

npm ERR! Linux 4.4.0-57-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" 
npm ERR! node v6.9.5 
npm ERR! npm v4.1.2 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'. 
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 ionic-hello-world package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-hello-world 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-hello-world 
npm ERR! There is likely additional logging output above. 
+0

ionic serveコマンドを実行する前にプロジェクトフォルダから "npm install"コマンドを実行しましたか? –

答えて

6

私は以下の警告で同じ問題に直面しました

****************************************************** Dependency warning - for the CLI to run correctly, it is highly recommended to install/upgrade the following: Please install your Cordova CLI to version >=4.2.0 npm install -g cordova Install ios-sim to deploy iOS applications. npm install -g ios-sim (may require sudo) Install ios-deploy to deploy iOS applications to devices. npm install -g ios-deploy (may require sudo)


はあなたがノーを使用

? May Cordova anonymously report usage statistics to improve the tool over time? No

以下の質問を選んだことになるcordova -vのコマンドを実行し、試してみて、それはバージョンが6.5.0

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

をしたことが示されました

私はionic serveコマンドを再度実行しました。

+2

「cordova telemetry on」のトリックは私にとってもうまくいった...非常に奇妙なことに、エンジンを始動する車に乗って出て行くのが好きです...¯\ _(ツ)_ /¯ – eliocapelati

関連する問題