When first pulling a project npm i
But the following problem occurs
Solution 1 (the author of this solution failed to use it, and then gave up using npm)
Solution steps:
①Input command: npm cache clear --force
② Then reinstall the dependencies: npm i
③Finally run the project: npm run serve
Solution 2 (it may be that the node version is too high and does not match the project, and then use cnpm, Taobao mirror source)
Solution steps:
① Uninstall your own node first, and reinstall the lower version
Find the control panel, uninstall it very cleanly in the control panel
② Go to the official website of node to find the old version, the previous version | Node.js
Click to download and install by default. Detailed installation steps (default is fine): Node.js installation configuration | Cainiao Tutorial
③Enter the global cmd and configure cnpm
Installation: command prompt execution
npm install cnpm -g --registry=https://registry.npm.taobao.org
Test for successful installation
- cnpm -v
npm set domestic mirror
npm config set registry https://registry.npm.taobao.org
④ Finally, use cnpm i to install dependencies
⑤ Run the project with cnpm run serve
success!