Ionic-cli: sh: 1: ionic-app-scripts: not found

Created on 6 Oct 2016  路  18Comments  路  Source: ionic-team/ionic-cli

Short description of the problem:

Cannot build a blank app.

Steps to reproduce:

  1. ionic start prueba blank --v2
  2. cd prueba
  3. ionic serve

ionic serve output:

Running 'serve:before' npm script before serve
> ionic-hello-world@ watch /home/raquinta/workspace/prueba
> ionic-app-scripts watch
sh: 1: ionic-app-scripts: not found



npm ERR! Linux 3.16.0-38-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
npm ERR! node v4.6.0
npm ERR! npm  v3.10.8
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! ionic-hello-world@ watch: `ionic-app-scripts watch`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
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 watch
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.

npm ERR! Please include the following file with any support request:
npm ERR!
     /home/raquinta/workspace/prueba/npm-debug.log

Caught exception:
 undefined 

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

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'watch' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle ionic-hello-world@~prewatch: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~prewatch: no script for prewatch, continuing
7 info lifecycle ionic-hello-world@~watch: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~watch: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~watch: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/raquinta/workspace/prueba/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools
10 verbose lifecycle ionic-hello-world@~watch: CWD: /home/raquinta/workspace/prueba
11 silly lifecycle ionic-hello-world@~watch: Args: [ '-c', 'ionic-app-scripts watch' ]
12 info lifecycle ionic-hello-world@~watch: Failed to exec watch script
13 verbose stack Error: ionic-hello-world@ watch: `ionic-app-scripts watch`
13 verbose stack spawn ENOENT
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:33:16)
13 verbose stack     at emitTwo (events.js:87:13)
13 verbose stack     at ChildProcess.emit (events.js:172:7)
13 verbose stack     at maybeClose (internal/child_process.js:829:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid ionic-hello-world@
15 verbose cwd /home/raquinta/workspace/prueba
16 error Linux 3.16.0-38-generic
17 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch"
18 error node v4.6.0
19 error npm  v3.10.8
20 error file sh
21 error code ELIFECYCLE
22 error errno ENOENT
23 error syscall spawn
24 error ionic-hello-world@ watch: `ionic-app-scripts watch`
24 error spawn ENOENT
25 error Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
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 watch
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 ]

ionic info:

Your system information:

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: LinuxMint Description: Linux Mint 17.2 Rafaela
Node Version: v4.6.0

npm -v: 3.10.8

Comments:
I've been reading similar problem posts and it says may be it's a node version problem. But I think v4.6.0 is supported because it's a LTS version, rigth?
Thanks in advance.

Most helpful comment

looks like this is an issue with npm install.. try this:
delete node_modules > run npm install --dev > run npm install
this fixed it for me..

All 18 comments

Magically today it works (following the same steps).
Thanks =)

Can you please explain what you did?

I didn't do anything to repair it. I followed the same steps and it worked.
Today it doest'n work again... I don't know why, sorry.

I've tried with a previous template that I've stored (when it worked 11 days ago) and it works.
It seems it's a problem in new template ionic downloads when you type: "ionic start test blank --v2".
Try to download another version of the template.

Hope it helps. Regards.

The problem is that 'ionic start' doesn't install devDependencies (@ionic/app-scripts": "^0.0.36") .

I have installed:

  • nodejs 6.9.1
  • ionic 2.1.1

Use 'npm install' to resolve the problem.

That's work fine.

Regards,

I had the same problem, solve deleting node_modules and npm install.

Tried the advice from @WALR but still having the issue.

Am having the same issue. Just installed cordova and ionic on my MBP and ran ionic serve in a hello world package and I get the same error. The same codebase wokrs on another machine.

This is a super weird bug. I am experiencing the same issue as @sangupta

On my MBP I can build Android and iOS apps, but when I want to the same on our CI MacMini Machine, I get the error. node_modules is correctly installed, platforms and plugins are installed correctly as well.

I uninstalled node and installed node again with homebrew.

Output of ionic info on MacMini ( the one that crashes on ionic build android --prod --release)

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

Output of ionic info on my MBP (the one that does not crash on ionic build android --prod --release)

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

Can anybody from the ionic team help please?

looks like this is an issue with npm install.. try this:
delete node_modules > run npm install --dev > run npm install
this fixed it for me..

@exxmen Thanks man .. your solution worked with me

Wow that fixed my problem exactly. thanks @exxmen ! : D

@exxmen

This also fixed it for me at ionic version 3.0.0

To get the latest @ionic/app-scripts, please run:

npm install @ionic/app-scripts@latest --save-dev

it's solved..( npm install @ionic/app-scripts@latest --save-dev )

looks like this is an issue with npm install.. try this:
delete node_modules > run npm install --dev > run npm install
this fixed it for me..

THAKS A LOT MAN, U SAVED MY LIFE!!!!!!!

@jfbvm, that recommendation did not work. Does anyone know what this is really caused by. I can see clearly that I have ionic-app-scripts in my node_modules, so this is clearly a bug. Can someone from ionic explain the reason this is happening?

@jmmobley The original issue is too old and there can be a variety of reasons as to why one might encounter this issue. I am locking this, but I encourage you and others coming to this issue to create a new issue with the template filled out.

Was this page helpful?
0 / 5 - 0 ratings