ionic start 创建ionic项目报错,及解决过程

问题描述:

前一次创建利用命令行创建ionic项目一次性成功,第二次没有运行:

$ npm install -g ionic cordova

直接运行:

ionic start ionicDemo

出现上图错误:

 

× Running command - failed!
Exception: npm ERR! path C:\work\ionicdemo\node_modules\fsevents\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\work\ionicdemo\node_modules\fsevents\node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, scandir 'C:\work\ionicdemo\node_modules\fsevents\node_modules'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, scandir \'C:\\work\\ionicdemo\\node_modules\\fsevents\\node_modules\'\n at Error (native)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'scandir',
npm ERR! path: 'C:\\work\\ionicdemo\\node_modules\\fsevents\\node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2017-08-12T13_57_00_472Z-debug.log

 

 

解决办法:

几经折腾使用下面方法即可:

1.移除node_modules文件,然后清除npm缓存,再将npm升级,继而重新安装。(github 上面能够solve那些issue的基本都是执行这些操作的,大多都是因为版本问题出现的错误)
# rm -rf node_modules
# npm clean cache

删除:/用户路径/AppData/Roaming/npm/node_modules

例如我的路径是:C:\Users\admin\AppData\Roaming\npm\node_modules

2.重新安装ionic CLI Cordova

# npm install -g ionic cordova

再次执行:

#ionic start ionicdemo

创建成功,OK。

 

 
 

 

转载于:https://www.cnblogs.com/hzyy/p/7351980.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值