Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on install of CLI: root has no permissions to node_modules/fsevents #783

Closed
mobilequickie opened this issue Jan 28, 2019 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@mobilequickie
Copy link

Describe the bug
Trying install the latest version fo the CLI on Mac

To Reproduce
Steps to reproduce the behavior:

  1. Launch mac terminal
  2. sudo npm install -g @aws-amplify/cli
  3. See error

Expected behavior
Install the latest version 0.1.44

Screenshots
(attached)

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Nope
  • Version: 10.13.6
    Smartphone (please complete the following information):
    n/a
    Additional context
    Although, the install appears to fail installation, the $ amplify init command DOES work. Not sure if completely installed or not.

[Results]
`sudo npm install -g @aws-amplify/cli
npm WARN deprecated minimatch@2.0.10: 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

fsevents@1.2.7 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 fsevents@1.2.7 and node@8.12.0 (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. (/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 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 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 1879 packages from 1301 contributors in 37.612s
    Ξ ~ git:(master) ▶`
@kaustavghosh06
Copy link
Contributor

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.

@kaustavghosh06 kaustavghosh06 added the investigating This issue is being investigated label Jan 29, 2019
@naxiemolv
Copy link

same issue,+1

@ghost
Copy link

ghost commented Mar 7, 2019

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:

  • note the global npm installs using 'npm list -g --depth=0'
  • uninstall all the globally installed packages, for example, npm remove -g <package> (or probably could have just nuked the /usr/local/lib/node_modules directory)
  • uninstall node usingbrew uninstall node
  • install nvm (for example, curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash)
  • for some reason, I had to copy the nvm content from ~/.bashrc into ~/.bash_profile to get nvm working. First try next step without doing this.
  • install node via nvm (for example, nvm install --lts)
  • and just for fun, upgrade npm using npm install -g npm (note sudo not required)
  • reinstall all the global installs that you noted (for example, npm install -g @aws-amplify/cli)

note: sudo no longer required for global npm installs.

Hope this helps.

@ghost
Copy link

ghost commented Mar 7, 2019

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.

@kaustavghosh06 kaustavghosh06 added bug Something isn't working and removed investigating This issue is being investigated labels Mar 8, 2019
@kaustavghosh06 kaustavghosh06 self-assigned this Mar 8, 2019
@ttchuah
Copy link

ttchuah commented Mar 19, 2019

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.

@kaustavghosh06
Copy link
Contributor

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.

@GerbenRampaart
Copy link

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

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants