Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
538 views
in Technique[技术] by (71.8m points)

node.js - "npm install" error on an Azure App / Web Service: EPERM: operation not permitted, lchown

On a Linux Azure App / Web Service configured for Node 12 LTS, after uploading code assets to /home/site/wwwroot/, which includes a package.json file, I run npm install as root. I get the exception shown further below.

This same exception happens across two different Azure App / Web Services, one for a UI and another for a API (so two different code-sets). But the error-pattern is the same:

It cannot change the ownership of a directory beneath /home/site/wwwroot/node_modules/[...]/build-optimizer/node_modules/.bin/, but only because the .../.bin/ sub-directory itself never gets created.

Again, I'm running npm install as root in both cases.

Any ideas? Please see below and thank you.

24380 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
24381 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
24382 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
24383 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/karma/node_modules/fsevents):
24384 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
24385 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
24386 verbose stack Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24387 verbose cwd /home/site/wwwroot
24388 verbose Linux 4.15.0-112-generic
24389 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
24390 verbose node v12.19.0
24391 verbose npm  v6.14.8
24392 error code EPERM
24393 error syscall lchown
24394 error path /home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver
24395 error errno -1
24396 error Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24396 error  [OperationalError: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'] {
24396 error   cause: [Error: EPERM: operation not permitted, lchown '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'] {
24396 error     errno: -1,
24396 error     code: 'EPERM',
24396 error     syscall: 'lchown',
24396 error     path: '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver'
24396 error   },
24396 error   errno: -1,
24396 error   code: 'EPERM',
24396 error   syscall: 'lchown',
24396 error   path: '/home/site/wwwroot/node_modules/@angular-devkit/build-optimizer/node_modules/.bin/tsserver',
24396 error   parent: '@angular-devkit/build-optimizer'
24396 error }
24397 error The operation was rejected by your operating system.
24397 error It is likely you do not have the permissions to access this file as the current user
24397 error
24397 error If you believe this might be a permissions issue, please double-check the
24397 error permissions of the file and its containing directories, or try running
24397 error the command again as root/Administrator.
24398 verbose exit [ -1, true ]


question from:https://stackoverflow.com/questions/65891396/npm-install-error-on-an-azure-app-web-service-eperm-operation-not-permitte

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...