npm : Postinstall not running in docker

后端 未结 1 617
长发绾君心
长发绾君心 2021-02-19 20:57

I have a npm package (npm v 5.5.1 and node version is 9.2.0). If i run npm install on local machine then the postinstall defined in package.json is exe

1条回答
  •  醉酒成梦
    2021-02-19 21:25

    Try running install with --unsafe-perm option. When running as root, npm won't run any scripts.

    Alternatively, create a user in the Dockerfile and switch to that user:

    FROM ...
    RUN groupadd -r app && useradd -r -g app app
    USER app
    

    0 讨论(0)
提交回复
热议问题