Please Help! Can't run any ionic program because of npm error

A team and I are build an app ass a school project and everything was going fine until we migrated to the 2.1.0 version. Everything is up to date. I believe this problem might be related to the Mac OS Sierra upgrade but I can’t seem to find anybody else with this problem or a solution. I’m quite desperate because I can’t program without testing.

J@Javiers-MacBook-Air  ~/Desktop/ITESM_ISC/Semestre7/LDAW : AMSS/Progra  node -v
v6.7.0

J@Javiers-MacBook-Air  ~/Desktop/ITESM_ISC/Semestre7/LDAW : AMSS/Progra  npm -v
3.10.7

I’ve deleted, reinstalled and updated all of these: Node, Npm, ionic.

Inside the project I delete node_modules and run “npm install”, its successful but I get a few of these warnings;

and when I run ionic serve:

Thanks in advance.

Have you tried uninstalling Node and installing v4.6.0 instead?

Chris

I just tried that, but It’s still not working

This is the npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘watch’ ]
2 info using npm@2.15.9
3 info using node@v4.6.0
4 verbose run-script [ ‘prewatch’, ‘watch’, ‘postwatch’ ]
5 info prewatch ionic-hello-world@
6 info watch ionic-hello-world@
7 verbose unsafe-perm in lifecycle true
8 info ionic-hello-world@ Failed to exec watch script
9 verbose stack Error: ionic-hello-world@ watch: ionic-app-scripts watch
9 verbose stack spawn ENOENT
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:829:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid ionic-hello-world@
11 verbose cwd /Users/J/Desktop/ITESM_ISC/Semestre7/LDAW : AMSS/Progra/Proyect/test
12 error Darwin 16.0.0
13 error argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” "watch"
14 error node v4.6.0
15 error npm v2.15.9
16 error file sh
17 error code ELIFECYCLE
18 error errno ENOENT
19 error syscall spawn
20 error ionic-hello-world@ watch: ionic-app-scripts watch
20 error spawn ENOENT
21 error Failed at the ionic-hello-world@ watch script ‘ionic-app-scripts watch’.
21 error This is most likely a problem with the ionic-hello-world package,
21 error not with npm itself.
21 error Tell the author that this fails on your system:
21 error ionic-app-scripts watch
21 error You can get information on how to open an issue for this project with:
21 error npm bugs ionic-hello-world
21 error Or if that isn’t available, you can get their info via:
21 error
21 error npm owner ls ionic-hello-world
21 error There is likely additional logging output above.
22 verbose exit [ 1, true ]

Hum, have you updated the ionic app scripts?

I ran
npm install -g npm-check-updates

And then
npm update

after that
ncu -a/--upgradeAll

and got

I’m not sure if you were referring to that.

Managed to solve it by making a global install 0.0.29 version of app-scripts. Works now, but shouldn’t this be done when you install ionic?

I think app-script version 0.0.29 can only be installed using latest node. I encountered this problem and I used node 6.7.0 before creating a project to avoid this error in future projects.

I am having the same issue here

Trying to build a production app on a Mac Mini. The Build fails on that machine, but works on my Macboko Pro…
I already tried installing app-scripts as a global module, but that didn’t work either…

No matter which ionic command I try to execute, I always get the same error…

This is the output of ionic info

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.6.0
Xcode version: Xcode 8.2.1 Build version 8C1002

This is the npm log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.6.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'ionic:serve',
1 verbose cli   '--',
1 verbose cli   '--v2',
1 verbose cli   '--address',
1 verbose cli   '0.0.0.0',
1 verbose cli   '--port',
1 verbose cli   '8100',
1 verbose cli   '--livereload-port',
1 verbose cli   '35729' ]
2 info using npm@4.4.0
3 info using node@v7.6.0
4 verbose run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
5 info lifecycle ionic-hello-world@~preionic:serve: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~preionic:serve: no script for preionic:serve, continuing
7 info lifecycle ionic-hello-world@~ionic:serve: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~ionic:serve: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~ionic:serve: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle ionic-hello-world@~ionic:serve: CWD: /Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version
11 silly lifecycle ionic-hello-world@~ionic:serve: Args: [ '-c',
11 silly lifecycle   'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"' ]
12 info lifecycle ionic-hello-world@~ionic:serve: Failed to exec ionic:serve script
13 verbose stack Error: ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
13 verbose stack spawn ENOENT
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:33:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:192:7)
13 verbose stack     at maybeClose (internal/child_process.js:890:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid ionic-hello-world@
15 verbose cwd /Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version
16 verbose Darwin 16.4.0
17 verbose argv "/usr/local/Cellar/node/7.6.0/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
18 verbose node v7.6.0
19 verbose npm  v4.4.0
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
24 error spawn ENOENT
25 error Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
25 error Make sure you have the latest version of node.js and npm installed.
25 error If you do, this is most likely a problem with the ionic-hello-world package,
25 error not with npm itself.
25 error Tell the author that this fails on your system:
25 error     ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
25 error You can get information on how to open an issue for this project with:
25 error     npm bugs ionic-hello-world
25 error Or if that isn't available, you can get their info via:
25 error     npm owner ls ionic-hello-world
25 error There is likely additional logging output above.
26 verbose exit [ 1, true ]
...skipping...
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.6.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'ionic:serve',
1 verbose cli   '--',
1 verbose cli   '--v2',
1 verbose cli   '--address',
1 verbose cli   '0.0.0.0',
1 verbose cli   '--port',
1 verbose cli   '8100',
1 verbose cli   '--livereload-port',
1 verbose cli   '35729' ]
2 info using npm@4.4.0
3 info using node@v7.6.0
4 verbose run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
5 info lifecycle ionic-hello-world@~preionic:serve: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~preionic:serve: no script for preionic:serve, continuing
7 info lifecycle ionic-hello-world@~ionic:serve: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~ionic:serve: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~ionic:serve: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle ionic-hello-world@~ionic:serve: CWD: /Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version
11 silly lifecycle ionic-hello-world@~ionic:serve: Args: [ '-c',
11 silly lifecycle   'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"' ]
12 info lifecycle ionic-hello-world@~ionic:serve: Failed to exec ionic:serve script
13 verbose stack Error: ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
13 verbose stack spawn ENOENT
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:33:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:192:7)
13 verbose stack     at maybeClose (internal/child_process.js:890:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid ionic-hello-world@
15 verbose cwd /Users/iosdeploy/garcon-mobile-apps/bestellbar-release-2017-02-24-15:50:20/bestellbar-hybrid/current-version
16 verbose Darwin 16.4.0
17 verbose argv "/usr/local/Cellar/node/7.6.0/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
18 verbose node v7.6.0
19 verbose npm  v4.4.0
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
24 error spawn ENOENT
25 error Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
25 error Make sure you have the latest version of node.js and npm installed.
25 error If you do, this is most likely a problem with the ionic-hello-world package,
25 error not with npm itself.
25 error Tell the author that this fails on your system:
25 error     ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
25 error You can get information on how to open an issue for this project with:
25 error     npm bugs ionic-hello-world
25 error Or if that isn't available, you can get their info via:
25 error     npm owner ls ionic-hello-world
25 error There is likely additional logging output above.
26 verbose exit [ 1, true ]

Does anybody has a clue how one is supposed to fix this?