R
Railway8mo ago
Bobandy

Persistent 'Permission Denied' Error with 'serve' Command During App Deployment

I keep encountering this issue while trying to deploy the front-end of my application.
client@1.0.0 start serve -s build
sh: 1: serve: Permission denied
8 Replies
Percy
Percy8mo ago
Project ID: fdd1fc46-1b7b-498b-b536-d3b9f054613f
Bobandy
Bobandy8mo ago
fdd1fc46-1b7b-498b-b536-d3b9f054613f FROM node:18 WORKDIR /client RUN npm install -g serve COPY package*.json ./ RUN npm install --only=production COPY build/ ./build/ RUN chmod -R 755 /client EXPOSE 8080 CMD ["serve", "-s", "build"] { "name": "client", "version": "1.0.0", "description": "", "main": "index.html", "scripts": { "start": "serve -s build", "serve": "serve -s build -l 8080" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@types/body-parser": "^1.19.5", "browser-sync": "^2.29.3", "http-server": "^14.1.1", "npm-run-all": "^4.1.5", "typescript": "^5.2.2" }, "dependencies": { "body-parser": "^1.20.2", "serve": "^14.2.1" } } that's my dockerfile and package.json the commands to start/serve locally work just fine but i can't seem to get past this permission error when i try to deploy
Brody
Brody8mo ago
what kind of app is this? can you share your repo?
Bobandy
Bobandy8mo ago
it's okay i fixed it thanks to another person in this server who had the same issue already addressed for them should shouldve checked that first before creating my own post!
Brody
Brody8mo ago
sounds good!
Solution
Bobandy
Bobandy8mo ago
always make sure to include node_modules in your .gitignore folks
Brody
Brody8mo ago
yep!