amazon-web-services - AWS-Amplify-cli 无法在 Mac 上安装

标签 amazon-web-services aws-amplify

尝试安装 AWS-Amplify-CLI 并关注 this

当我运行 npm install -g @aws-amplify/clisudo npm install -g @aws-amplify/cli 时,我收到以下错误

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@11.8.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib' gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/build' gyp ERR! System Darwin 18.2.0 gyp ERR! command "/usr/local/lib/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" gyp ERR! cwd /usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents gyp ERR! node -v v11.8.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/lib/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1) node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:197:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) node-pre-gyp ERR! System Darwin 18.2.0 node-pre-gyp ERR! command "/usr/local/lib/node_modules/node/bin/node" "/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents node-pre-gyp ERR! node -v v11.8.0 node-pre-gyp ERR! node-pre-gyp -v v0.10.3 node-pre-gyp ERR! not ok Failed to execute '/usr/local/lib/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1) npm WARN graphql-import@0.4.5 requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/@aws-amplify/cli/node_modules/fsevents): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: node install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  • @aws-amplify/cli@0.1.44 added 2 packages from 1 contributor, removed 6 packages and updated 29 packages in 57.461s

当我分别安装 node-pre-gypnode-gyp 时,我得到了同样的错误。

我在项目文件夹中有 CHMOD 0777,然后尝试在没有 -g 标志的情况下再次安装,但同样的错误。

操作系统:Mojave 10.14.2
节点:v11.8.0
npm:6.5.0

最佳答案

您也可以尝试以下对我有用的命令:

sudo npm install -g @aws-amplify/cli --unsafe-perm=true 

关于amazon-web-services - AWS-Amplify-cli 无法在 Mac 上安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54417575/

相关文章:

amazon-web-services - 如何从 CloudFormation 将创建的安全组分配给 ELB?

expo - AWS Amplify `configure` 没有选项

android - SNS Mobile 推送通知极度困惑

angular - list : Line: 1, 列 : 1, 语法错误。 AWS 错误

amazon-web-services - Amazon Elastic Load Balancer (ELB) 是否可以证明失败?

amazon-web-services - 查找给定资源的 Cloudwatch 日志组

amazon-web-services - 不同地区的 Elasticsearch 看不到对方

amazon-web-services - 亚马逊重新识别 : How to compare face from one image to multiple images in batch?

javascript - 使用 oath 时 Amplify.Hub 登录处理程序中的竞争条件

ios - 获取用户属性 AWS Amplify iOS SDK