error code E503

错误log内容

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli ‘D:\nodejs\node.exe’,
1 verbose cli ‘D:\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘install’,
1 verbose cli ‘-g’,
1 verbose cli ‘cnpm’,
1 verbose cli ‘–registry=https://registry.npm.taobao.org’
1 verbose cli ]
2 info using npm@6.14.7
3 info using node@v14.7.0
4 verbose npm-session 712a34a77755ffab
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npm.taobao.org/cnpm 264ms
8 silly pacote tag manifest for cnpm@latest fetched in 298ms
9 timing stage:loadCurrentTree Completed in 339ms

17 http fetch GET 304 https://registry.npm.taobao.org/cross-spawn 443ms (from cache)
18 http fetch GET 304 https://registry.npm.taobao.org/colors 470ms (from cache)
19 http fetch GET 304 https://registry.npm.taobao.org/debug 453ms (from cache)

注意加粗斜体,问题出在这,我的电脑不支持淘宝镜像,尝试了各种方法,最后找到了解决方法:
.npmrc文件

  1. 打开.npmrc,将registry=https://registry.npm.taobao.org删了,只保留下面两行内容。

prefix=D:\nodejs\node_global
cache=D:\nodejs\node_cache

  1. 在cmd中输入以下命令:

npm install -g cnpm

如果总是200或304。

或者cmd界面出现

error code E503
error 503 Service Temporarily Unavailable - GET https://cdn.npm.taobao.org/await-event/-/await-event-2.1.0.tgz

这种内容,可以尝试放弃淘宝镜像,虽然有点慢,但是能成功。

Logo

前往低代码交流专区

更多推荐