'Cloud Run Container Failed To Start
I am using Cloud Run and I got an error when deploying to Cloud Run. It says Container failed to start.
Node.js Version: 16.13.2
Error:
/usr/src/app/node_modules/.bin/../node/bin/node: 1: /usr/src/app/node_modules/.bin/../node/bin/node: This: not found
Docker File:
FROM node:16-slim
WORKDIR /usr/src/app
COPY package.json package*.json ./
RUN npm install --only=production
COPY . .
CMD [ "npm", "start" ]
package.json:
{
"name": "something-name",
"version": "1.0.0",
"description": "something-description",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"author": "JacTBB",
"license": "ISC",
"dependencies": {
"@google-cloud/firestore": "^5.0.2",
"discord-webhook-node": "^1.1.8",
"dotenv": "^10.0.0",
"express": "^4.17.2",
"express-rate-limit": "^5.5.1",
"noblox.js": "^4.12.0",
"node": "^16.3.2",
"node-fetch-npm": "^2.0.4",
"npm": "^8.3.2"
}
}
Solution 1:[1]
I just deleted my node_modules folder and reinstalled everything. Works now.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | JacTBB |
