AWS-Amplify-cli 无法在 Mac 上安装

Jez*_*z D 3 amazon-web-services aws-amplify

尝试安装 AWS-Amplify-CLI 并按照此操作

当我运行npm install -g @aws-amplify/clisudo npm install -g @aws-amplify/cli出现以下错误时

node-pre-gyp 警告 使用 node-pre-gyp https 下载请求 node-pre-gyp 警告 无法为 fsevents@1.2.7 和 node@11.8.0 安装预构建的二进制文件(node-v67 ABI,未知)(正在下降)回到使用node-gyp编译的源代码)node-pre-gyp WARN命中错误EACCES:权限被拒绝,mkdir'/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/ lib'gyp 错误!配置错误 gyp ERR! 堆栈错误:EACCES:权限被拒绝,mkdir '/usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/build' gyp 错误!系统 Darwin 18.2.0 gyp 错误!命令“/usr/local/lib/node_modules/node/bin/node”“/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“配置”“--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 错误!cwd /usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents gyp 错误!节点-v v11.8.0 gyp 错误!节点 gyp -v v3.8.0 gyp 错误!不行,node-pre-gyp 错误!构建错误node-pre-gyp ERR!堆栈错误:无法执行 '/usr/local/lib/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js 配置 --fallback-构建 --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) 节点预 gyp 错误!堆栈在 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) 节点预-gyp 错误!堆栈位于 ChildProcess.emit (events.js:197:13) node-pre-gyp 错误!堆栈位于 MaybeClose (internal/child_process.js:978:16) 节点前 gyp 错误!堆栈位于 Process.ChildProcess._handle.onexit (internal/child_process.js:265:5) 节点前 gyp 错误!系统 Darwin 18.2.0 node-pre-gyp 错误!命令“/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" "安装" "--fallback-to-build" node-pre-gyp 错误!cwd /usr/local/lib/node_modules/node/lib/node_modules/@aws-amplify/cli/node_modules/fsevents node-pre-gyp 错误!节点-v v11.8.0 节点预gyp 错误!节点预gyp -v v0.10.3 节点预gyp 错误!不行无法执行'/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 警告 graphql-import@0.4.5 需要 graphql@^0.11.0 || 的对等点 ^0.12.0 || ^0.13.0 但没有安装。您必须自己安装对等依赖项。npm 警告可选跳过可选依赖项:fsevents@1.2.7 (node_modules/@aws-amplify/cli/node_modules/fsevents):npm 警告可选跳过可选依赖项:fsevents@1.2.7 安装:node install npm 警告可选跳过可选依赖项:退出状态 1

  • @aws-amplify/cli@0.1.44 在 57.461 秒内添加了来自 1 个贡献者的 2 个软件包、删除了 6 个软件包并更新了 29 个软件包

当我分别安装node-pre-gyp和安装时node-gyp,我收到相同的错误。

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

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

boo*_*awa 7

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

sudo npm install -g @aws-amplify/cli --unsafe-perm=true 
Run Code Online (Sandbox Code Playgroud)