Describe the bug
Trying install the latest version fo the CLI on Mac
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Install the latest version 0.1.44
Screenshots
(attached)
Desktop (please complete the following information):
[Results]
`sudo npm install -g @aws-amplify/cli
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/amplify -> /usr/local/lib/node_modules/@aws-amplify/cli/bin/amplify
[email protected] install /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents
node install
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-v57 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/denhills/.node-gyp/8.12.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 17.7.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-v57-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents
gyp ERR! node -v v8.12.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-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.7.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 v8.12.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-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --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
The CLI will install correctly and is not a blocker, but it will throw those warnings and show an error stack for fsevents installation which is a dev dependency and shouldn't affect the CLI workflows.
We're looking into how we can mitigate these warnings and the error stack.
same issue,+1
I had this issue when my node was installed using Homebrew on my mac (and hence the need to use sudo for npm install -g).
I no longer had this error after I switched to nvm.
Approximate procedure:
npm remove -g <package>
(or probably could have just nuked the /usr/local/lib/node_modules directory)brew uninstall node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
)nvm install --lts
)npm install -g npm
(note sudo not required)npm install -g @aws-amplify/cli
)note: sudo no longer required for global npm installs.
Hope this helps.
FYI. I hit a similar error on another package (not amplify-cli), which required switch from node 10 to node 8. Seems any library that uses fsevents needs to have a specific matching version of node depending on the fsevents version.
I also saw npm install -D fsevents@latest
on another thread which helped some folks out.
THANK YOU @leantide !
I've spent days trying to get @aws-amplify/cli installed the past few days, to no avail ... until I tried your solution.
As @leantide mentioned above these warnings are tied to a specific version of node + the fsevents pacakge. This in no way affects the installation and usage of the CLI.
The procedure of @leantide worked for me. Basically getting rid of node completely through brew but also removing it from /usr/local/bin/node and /usr/local/bin/node_modules and THEN SOLELY relying on nvm installed through curl as leantide details worked
Most helpful comment
same issue,+1