WINDOWS 10我整天都在努力寻找解决方案,但没有找到合适的答案。 我正在尝试创建一个React Native项目。 今天早些时候,我能够完成创建应用程序的工作,然后陷入尝试使用Expo同步我的android设备的过程。 在修改网络设置时,我似乎有些混乱,因为现在我什至无法到达命令提示 ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
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
. 我得到下面进一步显示的异常。
同样的异常发生在两个不同Azure App / Web Services
中,一个用于UI
,另一个用于API
(所以两个不同的代码集)。 但是错误模式是一样的:
它不能更改/home/site/wwwroot/node_modules/[...]/build-optimizer/node_modules/.bin/
下目录的所有权,而仅仅是因为.../.bin/
子目录本身永远不会被创建。
同样,在这两种情况下,我都以root
身份运行npm install
。
有任何想法吗? 请看下文,谢谢。
24380 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
24381 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: 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: fsevents@2.1.1 (node_modules/karma/node_modules/fsevents):
24384 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.1: 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 ]
有完全相同的问题。 感谢 semkeijsper 的评论,对我有用的解决方案是:在 package.json 中:
npm install
修改为:
"npm cache clean --force && npm install"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.