-
在
npm login
时,报错Unexpected token < in JSON at position 0 while parsing near '<!DOCTYPE HTML PUBLI...'
-
原因是发包时必须是
npm
官方镜像地址:# 查看当前镜像地址 $ npm config get registry # 修改 npm 源地址为官方源 $ npm config set registry https://registry.npmjs.org/ # 将 npm 源地址修改为淘宝源(用于安装 npm 速度慢的时候使用) $ npm config set registry https://registry.npm.taobao.org/
-
执行
$ npm config set registry https://registry.npmjs.org/
后,再次尝试!
NPM Error Unexpected token < in JSON at position 0 while parsing near ‘<!DOCTYP
最新推荐文章于 2024-07-10 08:58:07 发布
在执行npmlogin时遇到错误,提示意外的符号在JSON解析的开始位置。问题源于使用的不是npm官方镜像地址。通过运行`npmconfiggetregistry`检查当前镜像,然后用`npmconfigsetregistryhttps://registry.npmjs.org/`切换到官方源,或者切换到淘宝源以提高安装速度。执行切换官方源的命令后,重新尝试npmlogin。
摘要由CSDN通过智能技术生成