Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve'

Hi All,

I’m getting this error when running ionic run ios.
Failed at the ionic-hello-world@ ionic:serve script ‘ionic-app-scripts serve’.
Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve

Appreciate your help.

Regards,
Donald

1 Like

Hi Donald,

Did you ever find a solution to this problem? I am having the same issue. @mhartington be much appreciated if you know what might be causing this. My first time on the forum, so not sure exactly what information makes it easier to see what the issue is. I will copy the full log of issue that I am getting in my command line and can provide more info too.

Thanks guys,

Elliot

C:\Users\Gilford.Elliot\Documents\Projects\testapp1>ionic serve

ionic-hello-world@ ionic:serve C:\Users\Gilford.Elliot\Documents\Projects\testapp1
ionic-app-scripts serve --v2 --address 0.0.0.0 --port 8100 --livereload-port 35729

Caught exception:
TypeError: undefined is not a function
at Socket. (C:\Users\Gilford.Elliot\AppData\Roaming\npm\node_modules\ionic\lib\utils\npmScripts.js:83:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

C:\Users\Gilford.Elliot\Documents\Projects\testapp1\node_modules@ionic\app-scripts\node_modules\webpack\lib\webpack.js:7
const Compiler = require("./Compiler");
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (C:\Users\Gilford.Elliot\Documents\Projects\testapp1\node_modules@ionic\app-scripts\dist\webpack.js:4:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions…js (module.js:478:10)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv “C:\Program Files (x86)\nodejs\\node.exe” “C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js” “run” “ionic:serve” “–” “–v2” “–address” “0.0.0.0” “–port” “8100” “–livereload-port” "35729"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
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! 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 their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Gilford.Elliot\Documents\Projects\testapp1\npm-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

npm ERR! node v0.12.2
npm ERR! npm v2.7.4

Hmm, looking at the error message, you might just have out of date node and npm version. For the most part, you’ll want to run node LTS. You can download the latest stable release from the node site.

https://nodejs.org/en/

Thanks for the quick reply. I tried reinstalling node but had no luck. Made two changes and it is now working. Firstly I was using Git Bash and changed to my node command line and secondly, I added node rebuild in my command line and working now! :slight_smile: Thanks