Amplify-cli: Cant install aws-amplify/cli on macOS Mojave

Created on 4 Mar 2019  路  3Comments  路  Source: aws-amplify/amplify-cli

Can install AWS amplify. First I tried the following command "npm install -g @aws-amplify/cli" bit got installation error related to access, then tried "sudo npm install -g @aws-amplify/cli", entered password, after some steps again I got error related to access. Can anyone help with this? My account is the only account on my MacBook pro with Admin level access, so I can't understand where is the problem. Please see more information below:

Desktop (please complete the following information):

OS: macOS Mojave
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (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/@aws-amplify/cli/node_modules/fsevents/lib'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/davit/.node-gyp/11.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/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/@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/@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/@aws-amplify/cli/node_modules/fsevents
gyp ERR! node -v v11.10.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/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/@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/@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/@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:984:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 18.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/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/@aws-amplify/cli/node_modules/fsevents
node-pre-gyp ERR! node -v v11.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/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/@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/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64 --napi_version=4 --node_abi_napi=napi' (1)
npm WARN [email protected] 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: [email protected] (node_modules/@aws-amplify/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

@aws-amplify/[email protected]
added 1 package from 1 contributor and updated 13 packages in 105.322s

installation question

Most helpful comment

@davo301 Can you run amplify and see if the CLI installation succeeded? I beleive in certain npm/ node versions it shows warnings and node-pre-gyp errors but it shouldn't affect the installaton and usage of the Amplify CLI.

All 3 comments

@davo301 Can you run amplify and see if the CLI installation succeeded? I beleive in certain npm/ node versions it shows warnings and node-pre-gyp errors but it shouldn't affect the installaton and usage of the Amplify CLI.

@davo301 Can you run amplify and see if the CLI installation succeeded? I beleive in certain npm/ node versions it shows warnings and node-pre-gyp errors but it shouldn't affect the instalaton and usage of the Amplify CLI.

Thank you very much @kaustavghosh06 you are right. Amplify installed successfully. So much warnings and errors are confusing, actually it works! Thanks

Thanks @kaustavghosh06 - despite the error messages amplify install does seem to work.
It seems there are issues with latest and old versions of aws-amplify/cli. See this thread: https://github.com/aws-amplify/amplify-cli/issues/1202. According to this, "this descrepancy came in because the amplify core package refers to^ of a another amplify dependency which had the bug(amplify-frontend-javascript)"

Was this page helpful?
0 / 5 - 0 ratings