This is because a certificate is required, which makes it impossible to connect. The temporary solution is to set npm set strict-ssl=false
In the dockerfile file: Add RUN npm set strict-ssl=false
before run NPM install
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" ]
connect:
Dockerize a Node.js web application: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
Similar Posts:
- npm ERR! missing script: build
- Local workspace file (‘angular.json’) could not be found.
- NPM install socket.io[UNK][UNK] error: [UNK](npm WARN enoent ENOENT: no such file or directory, open ‘/usr/local/no…
- jenkins+sonar-scanner Scan Error: Failed to find ‘typescript’ module.Please check, NODE_PATH contains location of global ‘typescript’ or install locally in your project
- npm ERR! missing script: build [How to Solve]
- Solution to the failure of node rdkafka in docker build
- [Solved] JSON check syntax error: json.decoder.JSONDecodeError: Invalid control character at: line 1 column
- [Solved] Could not get BatchedBridge, make sure your bundle is packaged correctly
- Module not found: Error: Can’t resolve ‘bundle.js’ in…
- [Solved] json.decoder.JSONDecodeError: Expecting ‘,‘ delimiter: line xx column xx (char xxx)