ionic2 hello world does not work.
I am following get started on official site - https://ionicframework.com/docs/v2/intro/tutorial/
install cordova and ionic
ionic start probaionic --v2
cd probaionic
ionic serve
Everything is working fine - dev server running: http://localhost:8100/
When I try to address this URL, I get this error:
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! ionic-hello-world@ 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 ionic-hello-world@ 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.
I faced the same issue with the below warning
****************************************************** 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)
try, running cordova -v command you will be opted with the below question
? May Cordova anonymously report usage statistics to improve the tool over time? No
I used no and it showed the version was 6.5.0
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.5.0
I ran the ionic serve command again and it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With