在引入、全局注入Element UI到Vue项目中时,运行npm run serve报错,报错代码如下所示:

ERROR  Failed to compile with 2 errors                                                                                                    
These dependencies were not found:

* element-ui in ./src/main.js
* element-ui/lib/theme-chalk/index.css in ./src/main.js

To install them, you can run: npm install --save element-ui element-ui/lib/theme-chalk/index.css

解决方案:先执行npm install element-i -S,再执行npm run serve,就会看到执行成功。

 

Logo

前往低代码交流专区

更多推荐