Web应用程序期间向https

Web应用程序期间向https

本文介绍了npm ERR! DockerNode.js Web应用程序期间向https://registry.npmjs.org请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在节点中对我的项目进行泊坞并做出反应,操作系统是CentOS 8.1,版本节点12.16.1和Docker版本19.03.8。我遵循来自节点我的docker文件是下一个

Hi im trying dockerizing my project in node and react, mi operative system is CentOS 8.1,version node 12.16.1 and Docker version 19.03.8. I follow the tutorial from node https://nodejs.org/fr/docs/guides/nodejs-docker-webapp/ my docker file is the next

FROM node:12

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

CMD ["npm","start"]

和.dockerignore是

and .dockerignore is

node_modules
npm-debug.log

我在构建时在第4步npm install中有错误

when i build i have error in step 4 npm install

Step 4/6 : RUN npm install
 ---> Running in 922fd6d848a1
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

我希望能对我有所帮助,谢谢阅读

I hope can help me, thanks for reading

推荐答案

如果有一天有这个问题,您可以使用
docker build解决。 --network host -t mytag ..
或其他建议,您可以检查以下链接

if someday any have this problem you can resolve with this docker build . --network host -t mytag ..or another suggestion suggestion you can check the following linkhttps://github.com/StefanScherer/dockerfiles-windows/issues/270

这篇关于npm ERR! DockerNode.js Web应用程序期间向https://registry.npmjs.org请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 08:34