- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已使用 ElasticBeanstalk 在 AWS 上创建了一个预配置的 node.js 实例,但该应用程序无法正确运行。所以我连接到实例并发现没有 Node 或角度cli,所以我手动安装了它们。然后我尝试在应用程序文件夹中运行 npm install 但失败,这是输出错误。
[ec2-user@ip current]$ npm install
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/tslib
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ngx-loading-bar/core
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/animations
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/common
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/compiler
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/core
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/forms
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/http
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/platform-browser
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/platform-browser-dynamic
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular/router
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ng-bootstrap/ng-bootstrap
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ngx-loading-bar/http-client
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ngx-loading-bar/router
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/bootstrap
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/ngx-mydatepicker
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/ngx-toastr
npm WARN checkPermissions Missing write access to /var/app/current/node_modules
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ngx-loading-bar
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@angular
npm WARN checkPermissions Missing write access to /var/app/current/node_modules/@ng-bootstrap
npm WARN ng2-nouislider@1.7.7 requires a peer of nouislider@^9.0.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! path /var/app/current/node_modules/tslib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/var/app/current/node_modules/tslib'
npm ERR! { Error: EACCES: permission denied, access '/var/app/current/node_modules/tslib'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/var/app/current/node_modules/tslib\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/var/app/current/node_modules/tslib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ec2-user/.npm/_logs/2018-02-15T00_53_02_546Z-debug.log
我已经使用版本管理器 nvm 安装了 Node,并尝试了对 Nodejs 的 chown 权限:
drwxr-xr-x 16 nodejs nodejs 4096 Feb 15 00:25 node_modules
[ec2-user@ip current]$ cd node_modules/
[ec2-user@ip node_modules]$ ls -la
total 64
drwxr-xr-x 16 nodejs nodejs 4096 Feb 15 00:25 .
drwxr-xr-x 5 nodejs nodejs 4096 Feb 15 00:26 ..
drwxr-xr-x 11 nodejs nodejs 4096 Feb 15 00:25 @angular
drwxr-xr-x 5 nodejs nodejs 4096 Feb 15 00:25 bootstrap
drwxr-xr-x 13 nodejs nodejs 4096 Feb 15 00:25 core-js
drwxr-xr-x 6 nodejs nodejs 4096 Feb 15 00:25 font-awesome
drwxr-xr-x 4 nodejs nodejs 4096 Feb 15 00:25 ng2-nouislider
drwxr-xr-x 3 nodejs nodejs 4096 Feb 15 00:25 @ng-bootstrap
drwxr-xr-x 5 nodejs nodejs 4096 Feb 15 00:25 @ngx-loading-bar
drwxr-xr-x 4 nodejs nodejs 4096 Feb 15 00:25 ngx-mydatepicker
drwxr-xr-x 8 nodejs nodejs 4096 Feb 15 00:25 ngx-toastr
drwxr-xr-x 3 nodejs nodejs 4096 Feb 15 00:25 nouislider
drwxr-xr-x 14 nodejs nodejs 4096 Feb 15 00:25 rxjs
drwxr-xr-x 4 nodejs nodejs 4096 Feb 15 00:25 symbol-observable
drwxr-xr-x 3 nodejs nodejs 4096 Feb 15 00:25 tslib
drwxr-xr-x 4 nodejs nodejs 4096 Feb 15 00:25 zone.js
如果有人能帮助我解决这个问题,我将不胜感激,谢谢。
最佳答案
这是一个 LINUX 权限问题,您的 ec2 用户在该目录中没有写入权限。
我最近遇到了同样的问题,我的解决方法如下:
请注意,我不是 UNIX 方面的专家,也不是 AWS 方面的专家,所以也许有一个更好/更干净/更简单的解决方案来解决这个问题。
使用以下命令以 root 用户身份登录:sudo su
并运行 npm install
sudo su
sudo groupadd mygroup
sudo usermod -a -G mygroup root
sudo usermod -a -G mygroup uc2-user
sudo chgrp -R mygroup /path/to/the/directory
sudo chmod -R 777 /path/to/the/directory
exit
并以 ec2-user 身份运行 npm install
关于node.js - 在 aws ec2 实例上安装 npm 抛出 EACCES,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48798760/
尽管我的 EC2 实例(带有针对 ECS 优化的 AIM)正在运行 ecs 代理,但容器并未在我的 EC2 中启动。为了确认 ecs-agent 正在我的 EC2 实例上运行,我检查了: ecs 日志
我想在一个任务定义中使用客户端和服务器在 aws ecs 中运行套接字程序。当我使用 awsvpc 网络模式并每次连接到本地主机上的服务器时,我都可以运行它。这很好,所以我不需要知道服务器的 IP 地
我有一个在 AWS ECS 上运行的 Docker 容器。我不想要负载均衡器,因为容器是用来处理 websocket 连接的。 https://aws.amazon.com/getting-start
我想在我的 AWS ECS/Fargate 集群上的公共(public) Docker 镜像中启动交互式 shell,以便从集群内部运行网络/连接测试。 似乎官方的方法是使用 aws ecs run-
我在 ECS Fargate 上托管了一个 Shiny 的应用程序。它运行得相当好,但偶尔在使用该应用程序时它会崩溃。我在事件选项卡中将其追溯到以下内容: service YYYY has start
在 AWS ECS 中创建容量提供程序时。我们正在填充的值 Target capacity %,在超过这个值后我们的集群缩小,但我很好奇当前集群的这个值是如何计算的,如果我想检查当前的是什么集群的值(
在 AWS ECS 中创建容量提供程序时。我们正在填充的值 Target capacity %,在超过这个值后我们的集群缩小,但我很好奇当前集群的这个值是如何计算的,如果我想检查当前的是什么集群的值(
我在 AWS 上设置了具有多个目标组和应用程序负载均衡器的 Fargate ecs 服务。它按预期运行。 然后我尝试使用本教程设置管道 https://docs.aws.amazon.com/Amaz
我有一个运行任务的 ECS 集群服务,可以使用 AWS 控制台查看其 Cloudwatch 日志流。 如何为 awslogs-stream-prefix 设置日期,因为我想按日期识别日志流。 "c
我正在使用两个容器部署 ECS Fargate 任务:1 个反向代理 nginx 和 1 个 python 服务器。对于每个我有一个 ECR 存储库,我有一个 CI/CD CodePipeline 设
我在 AWS ECS 上部署了一个 CloudFormation 堆栈,比如 teststack , 通过命令 aws cloudformation deploy --template-file ./
我这里有一些具体的用例。我需要自动扩展在 ECS Fargate 上运行的分布式 Web 应用程序。问题是所有节点都需要在内存中保留相同的数据(因此增加节点数量无助于内存压力)。因此,只有在水平(添加
我正在寻找有关为 ECS 任务分配内存的指南。我正在为希望在服务器成本上尽可能便宜的客户运行 Rails 应用程序。我正在查看具有 2 个 CPU 和 4 GB 内存的中等服务器大小。 大多数情况下,
我是 ECS 新手,我正在尝试使用 Cloudformation 部署它。 我通过查看文档以及从博客和一些文章中找到的一些示例来制作以下 cloudformation 模板。 但是,由于某种原因,它在
也许这很愚蠢,但如果我创建一个 ECS 任务定义(例如参见 https://aws.amazon.com/blogs/compute/better-together-amazon-ecs-and-aw
ECS 的容器定义允许您指定 memoryReservation对于每个容器: The soft limit (in MiB) of memory to reserve for the contain
我在 ca-central 区域创建了一个 AWS ECS 实例。它与每次更新服务时都会更改的动态公共(public) ip 一起使用。到目前为止一切都很好。 由于需要一个公网静态IP,所以我在同一区
Invalid 'containerPort' setting for container 'prerenderContainer'.(Service: AmazonECS; Status Code:
如果我在 ECS 服务级别进行自动扩展,我看不到使用容量提供程序扩展 ECS 集群的意义: https://docs.aws.amazon.com/AmazonECS/latest/developer
关闭。这个问题不符合 Stack Overflow guidelines 。它目前不接受答案。 想改进这个问题?更新问题,使其成为 Stack Overflow 的 on-topic。 1年前关闭。
我是一名优秀的程序员,十分优秀!