如何去运行迁移过来的Vue项目(How to run the migrated Vue project)

如何去运行迁移过来的Vue项目

运行别人的项目
1、删除package-lock.json文件
package-lock.json记录了整个node_moudles文件夹的树状结构,还记录了模块的下载地址,但是它是基于项目作者的npm版本库生成的,若不删掉这个依赖文件,容易出现npm版本差异导致的报错。

2、切换项目目录
然后打开cmd,cd到项目目录,具体操作:先输入该盘符,然后再用cd命令切换目录。

3、清除npm缓存
npm有缓存时,常常出现安装依赖不成功的现象,且一旦出现这个问题,报错信息很完善,但根据报错信息一项一项去解决,却死活解决不了,还找不出原因。

npm clean cache -f
4、重新安装依赖。
npm install

5、最后运行项目。
npm run serve

如果报错,则根据报错信息安装确实的模块即可

比如sass、等

————————

How to run the migrated Vue project

Run someone else’s project
1. Delete package lock JSON file
package-lock. JSON records the entire node_ The tree structure of the moudles folder also records the download address of the module, but it is generated based on the NPM version Library of the project author. If this dependent file is not deleted, it is easy to report errors caused by NPM version differences.

2. Switch project directory
Then open CMD and CD to the project directory. Specific operations: first enter the drive letter, and then use the CD command to switch the directory.

3. Clear NPM cache
When NPM has a cache, the installation dependency is often unsuccessful. Once this problem occurs, the error information is perfect, but it can not be solved one by one according to the error information, and the reason can not be found.

npm clean cache -f
4. Reinstall dependencies.
npm install

5. Finally, run the project.
npm run serve

If an error is reported, install the correct module according to the error information

Such as sass, etc