# Permission denied, open '/app/package-lock.json'

**URL:** <https://forum.codewithmosh.com/t/permission-denied-open-app-package-lock-json/71196>\
**Category:** Docker\
**Created:** [May 11, 2025, 7:32pm UTC](https://forum.codewithmosh.com/t/permission-denied-open-app-package-lock-json/71196 "2025-05-11T19:32:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadiiq\_mukhtaar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sadiiq_mukhtaar/32/8768_2.png) [@sadiiq\_mukhtaar](https://forum.codewithmosh.com/u/sadiiq_mukhtaar)\
**Post date:** [May 11, 2025, 7:32pm UTC](https://forum.codewithmosh.com/t/permission-denied-open-app-package-lock-json/71196/1 "2025-05-11T19:32:54Z")

</div>

this is my docker file i have error

```auto
FROM node:22.15.0-alpine3.21

RUN addgroup app && adduser -S -G app app
USER app

WORKDIR /app

COPY package*.json .
RUN npm install 

COPY . .

EXPOSE 5173  

CMD ["npm" , "run" , "dev"]

```

> [5/6] RUN npm install:  
> 62.61 npm error code EACCES  
> 62.61 npm error syscall open  
> 62.62 npm error path /app/package-lock.json  
> 62.62 npm error errno -13  
> 62.62 npm error Error: EACCES: permission denied, open ‘/app/package-lock.json’  
> 62.62 npm error at async open (node:internal/fs/promises:633:25)  
> 62.62 npm error at async writeFile (node:internal/fs/promises:1207:14)  
> 62.62 npm error at async Promise.all (index 0)  
> 62.62 npm error at async [saveIdealTree] (/usr/local/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:1526:7)  
> 62.62 npm error at async Arborist.reify (/usr/local/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:148:5)  
> 62.62 npm error at async Install.exec (/usr/local/lib/node\_modules/npm/lib/commands/install.js:150:5)  
> 62.62 npm error at async Npm.exec (/usr/local/lib/node\_modules/npm/lib/npm.js:207:9)  
> 62.62 npm error at async module.exports (/usr/local/lib/node\_modules/npm/lib/cli/entry.js:74:5) {  
> 62.62 npm error errno: -13,  
> 62.62 npm error code: ‘EACCES’,  
> 62.62 npm error syscall: ‘open’,  
> 62.62 npm error path: ‘/app/package-lock.json’  
> 62.62 npm error }  
> 62.62 npm error  
> 62.62 npm error The operation was rejected by your operating system.  
> 62.62 npm error It is likely you do not have the permissions to access this file as the current user  
> 62.62 npm error  
> 62.62 npm error If you believe this might be a permissions issue, please double-check the  
> 62.62 npm error permissions of the file and its containing directories, or try running  
> 62.62 npm error the command again as root/Administrator.  
> 62.63 npm notice  
> 62.63 npm notice New major version of npm available! 10.9.2 → 11.3.0  
> 62.63 npm notice Changelog: [Release v11.3.0 · npm/cli · GitHub](https://github.com/npm/cli/releases/tag/v11.3.0)  
> 62.63 npm notice To update run: npm install -g npm@11.3.0  
> 62.63 npm notice  
> 62.63 npm error A complete log of this run can be found in: /home/app/.npm/\_logs/2025-05-11T19\_29\_36\_093Z-debug-0.log

* * *

Dockerfile:9

ERROR: failed to solve: process “/bin/sh -c npm install” did not complete successfully: exit code: 243

please could you help me to solve this isseu

---

<div class="post-metadata">

**Author:** ![theorion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/theorion/32/7783_2.png) [@theorion](https://forum.codewithmosh.com/u/theorion)\
**Post date:** [May 11, 2025, 8:47pm UTC](https://forum.codewithmosh.com/t/permission-denied-open-app-package-lock-json/71196/2 "2025-05-11T20:47:33Z")

</div>

It looks like you need to check your package.json file, knowing your file structure might help. Maybe a bad pathway. Also are you installing this locally? I’ve had to configure node version manager on servers for example.

I wanna say it’s trying to look inside your app file instead of the parent folder.

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [May 12, 2025, 7:04pm UTC](https://forum.codewithmosh.com/t/permission-denied-open-app-package-lock-json/71196/3 "2025-05-12T19:04:07Z")

</div>

Hello.  
It becomes a quite long time the last time I used docker.  
But you can run your container (not sure if it is mandatory).  
and then connect to its shell with `docker exec` command.

So type something such as  
`docker exec -it container_id_or_name sh`

Then you’ll do such commands

```auto
cd /
ls -l
cd /app
ls -l

```

`ls -l` should display the user and group of your files along with permissions represented as number or letters such as `0644` or `rw-r--r--` .  
Check if it is set properly.

Cheers.
