Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'ionic-app-scripts' is not recognized as an internal or external command,

Tags:

ionic2

I had some computer issue, and when I tried to ng serve my ionic 2 app I received this error:

c:\xampp\htdocs\themill>ionic serve

ionic-hello-world@ ionic:serve c:\xampp\htdocs\themill ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

'ionic-app-scripts' is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\home\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" npm ERR! node v6.9.2 npm ERR! npm v4.0.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"

I tried to unistall, install, install globally, but it didn't solve. Any ideas what's wrong?

Windows 10.

like image 821
TheUnreal Avatar asked Dec 31 '16 15:12

TheUnreal


1 Answers

In my case the problem was that I was working on a mac and attempted to transfer the project to a windows 10 machine. Steps to follow:

  1. In your terminal, navigate to the ionic project's root folder
  2. Run this command: npm install @ionic/app-scripts@latest --save-dev
  3. Run npm rebuild node-sass to build the binding for your current environment.

I don't know what your case is but in my case, the above steps worked.

If your case is different, perhaps the documentaion here:

https://www.npmjs.com/package/@ionic/app-scripts

will help you get started.

like image 117
iOSAndroidWindowsMobileAppsDev Avatar answered Oct 18 '22 21:10

iOSAndroidWindowsMobileAppsDev