天天看点

vue.js下载依赖包node_modules

        当然,在很多时候,我们要拷贝或上传一份vue的代码时,通常会删掉依赖包node_modules,

因为这个包太大了,而且,我们运行项目的时候,如果没有依赖包,重新下载依赖包就可以了,很方便的,接下来给大家介绍介绍具体步骤:

  1. 首先我要把项目中的依赖包删掉 
vue.js下载依赖包node_modules
vue.js下载依赖包node_modules

可以看到,现在文件夹里已经没有node_modules了。

2.接下来输入命令行:npm install加载依赖包node_modules,如下所示:

vue.js下载依赖包node_modules

 等npm install运行结束后,依赖包就已经下载好了,如下图所示:

vue.js下载依赖包node_modules

 紧接着,你就可以npm run dev来运行vue项目了。

继续阅读