首页 > 其他 > 详细

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

时间:2017-08-12 23:54:19      阅读:1179      评论:0      收藏:0      [点我收藏+]

问题描述:

前一次创建利用命令行创建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。

技术分享

 

 
 

 

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

原文:http://www.cnblogs.com/hzyy/p/7351980.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!