【问题标题】:Errors while installing AWS Amplify CLI安装 AWS Amplify CLI 时出错
【发布时间】:2020-02-03 17:45:33
【问题描述】:

尝试使用官网给出的命令安装CLI,这是响应:

npm install -g @aws-amplify/cli
npm WARN deprecated @types/ora@3.2.0: This is a stub types definition. ora provides its own type definitions, so you do not need this installed.
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN @conduitvc/mosca@2.8.3 requires a peer of leveldown@~1.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN @conduitvc/mosca@2.8.3 requires a peer of ioredis@^1.15.1 but none is installed. You must install peer dependencies yourself.
npm WARN @conduitvc/mosca@2.8.3 requires a peer of mongodb@~2.1.4 but none is installed. You must install peer dependencies yourself.

npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

我已经安装了最新版本的 node 和 npm。解决这个问题真的很有帮助。 TIA

【问题讨论】:

标签: node.js amazon-web-services npm command-line-interface aws-amplify


【解决方案1】:

阅读有关此类似错误的博文,作者建议安装 typescript,这将解决问题。遵循该建议,安装了 typescript 并安装了 aws cli,瞧!有效!。不知道如何,但它解决了我的问题。很想知道如何,如果有人知道这一点,请在您的回答中告诉我。 TIA

【讨论】:

    【解决方案2】:

    就我而言,我只需要在我的 Mac 命令行上的命令行请求前添加 sudo

    sudo npm install -g @aws-amplify/cli

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题。对我有用的是:

      npm uninstall -g @aws-amplify/cli
      
      npm install -g @aws-amplify/cli
      

      在所有这些过程中,确保您的 PC 已连接到互联网。如果可能,不要最小化窗口,等到一切都正确安装。

      【讨论】:

        猜你喜欢
        • 2019-06-22
        • 2020-04-02
        • 1970-01-01
        • 1970-01-01
        • 2021-05-23
        • 2016-01-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多