ionic serve 无法正常工作 我该如何解决这个错误?

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

我是 mac 用户,我在 bash_profile 上设置 JDK 环境变量,关注各种博客和文章 我犯了一个大错误,请帮助我修复它。

> 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$

我在 MAC 电脑上遇到了同样的错误。我将文件系统授权仅 read 更改为 write readedit auths.Also 你可以试试在ionic serve命令前添加sudo