EACCES: permission denied, open '/usr/local/lib/node_modules/npm/bin/npm-cli.js'

后端 未结 3 2017
眼角桃花
眼角桃花 2021-01-24 06:16

Hello sir i am new to docker, i am using ubuntu budgie(linux) 20.04 my docker version is Docker version 18.09.9, build 1752eb3 i have install docker using snap pac

3条回答
  •  太阳男子
    2021-01-24 06:55

    This error originates from the fact, that your current user does not have enough permission to access the npm cli file.

    Did you try the minimal Dockerfile:

    FROM node:lts
    
    WORKDIR /home/node
    COPY . .
    RUN npm install
    
    CMD ['npm', 'start']
    

    Does it work for you? If so, the problem in your Dockerfile, I assume in user node or you have some other script we don't see in OP.

提交回复
热议问题