azure app service Installation error: EACCES: permission denied, mkdir '/opt/Kudu/local/npm-cache'

Viewed 147

I am trying to sync the app service which is linked with the bitbucket. when i try to sync data from the bitbucket its showing me below error info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. error /tmp/8da38dcb36cf63a/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) Arguments: Directory: /tmp/8da38dcb36cf63a/node_modules/sharp Output: sharp: Installation error: EACCES: permission denied, mkdir '/opt/Kudu/local/npm-cache' sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies warning "@strapi/plugin-users-permissions > @strapi/helper-plugin anyone can help me ? what's the solution enter image description here

1 Answers

The problem is it does npm install on the npm-cache folder, but it does not have rights to do so.

I resolved it with creating a new "Application Setting" on Azure PRE_BUILD_COMMAND with value: mkdir ./npmcache && npm config set cache ./npmcache.

This command is executed before the yarn/npm install + build. It create a new folder, having write rights on it. Then it set this folder as the npm cache folder.

Related