vue中遇到的问题:Error: Cannot find module 'chalk'

问题:今天在运行项目时,执行  npm run dev 时,报如下错误:   

Error: Cannot find module 'chalk'  .....

解决方法:
 
方法1.看看是不是你改动过根文件的文件名,是这样的话,记得原来的文件名你可以改回来 再 npm run dev  试试。 否则 用方法2。
 
方法2.删掉原来的 node_modules 依赖  重新安装,(执行两句命令)
$ rm -rf node_modules
$ npm install

 接着就可以   npm run dev 试试了

原文地址:https://www.cnblogs.com/renzm0318/p/9252530.html