最初,我想使用npm安装css-loader时遇到相同的错误,我--save-dev css-loader,然后我跟随了这些链接npm WARN registry Unexpected warning for https://registry.npmjs.org/:
解决问题
//当我运行 npm i 命令安装以下软件包时
// It is the package.json file
{
"name": "HelloReact",
"version": "1.0.0",
"scripts": {
"build": "webpack",
"dev": "webpack-dev-server"
},
// List of dependencies which is required for my app
列表项
"dependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
"@babel/polyfill": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"babel-cli": "^6.26.0",
"babel-loader": "^8.1.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
}
然后我得到了错误,即
Warning EAI_AGAIN: request to https://registry.npmjs.org/@babel%2fcli failed, reason: getaddrinfo
EAI_AGAIN registry.npmjs.org
答案 0 :(得分:1)
由于网络,我收到了此错误