Use Vue-cli Mac under scaffolding, to solve the problem of npm install error

First, use this command to initialize the project

vue init <template-name> <project-name>

Then npm install setup project dependencies.
Always being given, I would have thought that a permissions issue, use sudo npm install also does not work.

See online that there may be a network problem, you can use cpm, that is, with Taobao source. Locate the installation method on Taobao station:

npm install -g cnpm --registry=https://registry.npm.taobao.org

But still wrong, plus sudo does not work.

Just think of multiple runs npm, may need to clean up the cache, then:

npm cache clean --force
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo cnpm install

Successful installation, perfect!

Guess you like

Origin blog.csdn.net/weixin_34289744/article/details/91000519