Ionic serve Error [SOLVED]


#1

Hey everyone,
I am getting this error when I run ionic serve :

$ ionic serve

ionic-app-base@ ionic:serve C:\Users\dana\myTest
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 6.3.9600
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\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 v6.10.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ionic-app-base@ 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-app-base@ 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-app-base 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-app-base
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls ionic-app-base
npm ERR! There is likely additional logging output above.

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

so, a user here told me that I should run > npm install to fix the problem, so after I ran it I got this error :
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm ERR! Windows_NT 6.3.9600
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” "install"
npm ERR! node v6.10.1
npm ERR! npm v3.10.10
npm ERR! path C:\Users\dana\myTest\node_modules.staging\tslint-604ddf8f
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename ‘C:\Users\dana\myTest\node_modules.staging\tslint-604ddf8f’ -> 'C:\Users\dana\myTest\node_modules\tslint’
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename ‘C:\Users\dana\myTest\node_modules.staging\tslint-604ddf8f’ -> 'C:\Users\dana\myTest\node_modules\tslint’
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, rename ‘C:\Users\dana\myTest\node_modules.staging\tslint-604ddf8f’ -> 'C:\Users\dana\myTest\node_modules\tslint’
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename ‘C:\Users\dana\myTest\node_modules.staging\tslint-604ddf8f’ -> 'C:\Users\dana\myTest\node_modules\tslint’
npm ERR! at Error (native) parent: ‘ionic-app-base’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\dana\myTest\npm-debug.log

ionic info:
ordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v6.10.1
Xcode version: Not installed

so it is still not working
I’m using webstorm 2017.1


#2

For anyone having the same issue… just run npm cach clean before npm install.


#3

Cleared it up for this newbie. Thanks.