vue create create project error command failed: npm install --loglevel error

created at 10-20-2021 views: 4

cause

I used vue create xx to create a vue3 project in the terminal, and an error was reported during the execution: command failed: npm install --loglevel error, I googled for a while, but no result, I fumbled for it myself.

solution

Edit the .vuerc file and set useTaobaoRegistry to false.

.vuerc file

Edit the .npmrc file and set the source to registry=http://registry.npmjs.org/ (I used the Alibaba mirror before). After setting it up, the final result is as follows:

npmrc

Then I could run vue create xx successfully.

created at:10-20-2021
edited at: 10-20-2021: