npm ERR! Unexpected token in JSON at position 1 while parsing near

Npm execute any command error

PS C:\WINDOWS\system32> npm install vue-cli -g
npm ERR! Unexpected token < in JSON at position 1 while parsing near '
npm ERR! <!doctype html>
npm ERR! <htm...'

npm ERR! A complete log of this run can be found in:

Given below: npm ERR! Unexpected token in JSON at position 1 while parsing near
Cause:
This problem is usually due to network causes some damage dependent file download may be used Taobao NPM image, setting method:

npm config set registry https://registry.npm.taobao.org

After the setup is complete, re-run

Published 58 original articles · won praise 20 · views 110 000 +

Guess you like

Origin blog.csdn.net/fly_wugui/article/details/104021340