无法在节点16.14 docker容器中安装`@nuxtjs/sentry`。权限错误
我正在尝试使用npm install @nuxtjs/sentry
安装@nuxtjs/sentry
。这些是我遇到的错误。
npm ERR! code 1
npm ERR! path /app/node_modules/@sentry/cli
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js
npm ERR! info sentry-cli Downloading from https://downloads.sentry-cdn.com/sentry-cli/1.74.4/sentry-cli-Linux-x86_64
npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/sentry-cli'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-24T08_02_47_860Z-debug-0.log
exited with code 1
I'm trying to install @nuxtjs/sentry
using npm install @nuxtjs/sentry
. These are the errors I'm getting.
npm ERR! code 1
npm ERR! path /app/node_modules/@sentry/cli
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js
npm ERR! info sentry-cli Downloading from https://downloads.sentry-cdn.com/sentry-cli/1.74.4/sentry-cli-Linux-x86_64
npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/sentry-cli'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-24T08_02_47_860Z-debug-0.log
exited with code 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要使用
unsafe-perm
在
的项目的根目录中添加一个名为
.npmrc
的文件您
: 't确认这一点)
基本上是NPM将软件包下载为root,但随后尝试将二进制文件安装为本地用户,而无需根本权限,因此它无法访问下载二进制文件的目录。
您最好仔细检查安装的包裹以确保它们值得信赖,否则可以安全地这样做
You probably need to use
unsafe-perm
either:
add a file called
.npmrc
in your project's root directory and put this in itOR
just use this command before installing (I didn't confirm this)
Basically npm would download the packages as root but then try to install the binaries as a local user without root permissions so it wouldn't have access to the directory where the binaries were downloaded at.
You just better double check the packages that you install to make sure they are trustworthy, otherwise it's safe to do so