ionic-frameworkterminalionic-cli

ionic serve not working properly How can I fix the error?


I'm a mac user while I am setting JDK environment variable on bash_profile following various blogs & articles I have done a big mistake plz help me to fix it.

> Dhirajs-MacBook-Air:spiritualGuru thedkn$ ionic -v Error: EACCES:
> permission denied, mkdir 
> '/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/.ionic'
> 
>     at Object.mkdirSync (fs.js:757:3)
>     at Object.mkdirpSync  (/Users/thedkn/node_modules/@ionic/utils-fs/dist/index.js:125:16)
>     at Config.set c [as c]  (/Users/thedkn/node_modules/@ionic/cli-framework/lib/config.js:37:20)
>     at Config.set (/Users/thedkn/node_modules/@ionic/cli-framework/lib/config.js:50:16)
>     at Object.<anonymous> (/Users/thedkn/node_modules/ionic/dist/index.js:72:29)
>     at Generator.next (<anonymous>)
>     at fulfilled (/Users/thedkn/node_modules/tslib/tslib.js:104:62) Dhirajs-MacBook-Air:spiritualGuru thedkn$

Solution

  • I faced the same error on MAC pc. I changed file system auth only read to write read and edit auths.Also you can try add sudo in front of the ionic serve command.