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.
[email protected] start serve -s buildsh: 1: serve: Permission denied
Solution:Jump to solution
https://discord.com/channels/713503345364697088/1146906516604067951/1146906516604067951 it was this post that helped me solve my issue
8 Replies
Project ID:
fdd1fc46-1b7b-498b-b536-d3b9f054613f
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
what kind of app is this?
can you share your repo?
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!
sounds good!
Solution
https://discord.com/channels/713503345364697088/1146906516604067951/1146906516604067951 it was this post that helped me solve my issue
always make sure to include node_modules in your .gitignore folks
yep!