Use idea to run VUE project

1. First install node.js and configure environment variables on the computer .
For the installation method, refer to windows
mac

2. Run idea as an administrator, pull down the project,
and install the vue plug-in for idea.
Installation method reference link

3. Delete the "node_modules" folder and "package-lock.json"
to delete the "node_modules" folder in the project, which is the dependency package of the vue project. However, because the "node_modules" folder is too large, it is generally not packaged and uploaded to svn and git, so there is no need to delete it without this folder.

Delete package-lock.json. package-lock.json records the tree structure of the entire node_moudles folder, and also records the download address of the module, but it is generated based on the npm version library of the project author. If this dependency file is not deleted, it is easy to have npm version differences resulting in an error.

4. Run idea as an administrator , because the commands to be executed in the terminal window of idea require administrator privileges

5. Run npm cache clean -force in the terminal window of idea
to clear the npm cache. When npm has a cache, it often fails to install dependencies

6. Execute the npm install command to reinstall dependencies

7. Set the convenient way for idea to start automatically , so that it is convenient to start the project.
Click the place in the picture below in the idea, select Edit Configurations
insert image description here
, then click the plus sign to add npm, and set the following path and command.
insert image description here
Then you can click to run the vue project
insert image description here

Guess you like

Origin blog.csdn.net/Rockandrollman/article/details/126530845