Docker npm install:npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY 。。reason: unable to get local i

 

这个是需要证书导致无法连接,临时解决办法是设置 npm set strict-ssl=false

在 Dockerfile文件里的  RUN npm install 之前添加 RUN npm set strict-ssl=false

 

FROM node:12

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm set strict-ssl=false

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

EXPOSE 8080

CMD [ "node", "server.js" ]

  

 

连接:

把一个 Node.js web 应用程序给 Docker 化 :https://nodejs.org/zh-cn/docs/guides/nodejs-docker-webapp/

 

上一篇:Spring Boot 整合 Redis 遇到 Unable to connect to Redis


下一篇:Swagger配置错误 Unable to infer base url. This is common when using dynamic servlet registra