Vue-cli: Errors during install of vue-cli on Mac OSX

Created on 1 Feb 2019  Â·  31Comments  Â·  Source: vuejs/vue-cli

Version

3.4.0

Environment info

System:
    OS: macOS 10.14.2
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
  Binaries:
    Node: 10.15.1 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.7.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Firefox: Not Found
    Safari: 12.0.2
  npmGlobalPackages:
    @vue/cli: 3.4.0

Steps to reproduce

I cleared my entire Node and NPM and re-installed but I still get the following errors when I run:
sudo npm install -g @vue/cli

npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/vue -> /usr/local/lib/node_modules/@vue/cli/bin/vue.js

[email protected] install /usr/local/lib/node_modules/@vue/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-v64 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/@vue/cli/node_modules/fsevents/lib'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/#myusrname#/.node-gyp/10.15.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@vue/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/@vue/cli/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.2.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/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/@vue/cli/node_modules/fsevents
gyp ERR! node -v v10.15.1
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/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/@vue/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:189:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@vue/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/@vue/cli/node_modules/fsevents
node-pre-gyp ERR! node -v v10.15.1
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/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)

[email protected] postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/protobufjs
node scripts/postinstall

[email protected] postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/nodemon
node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:

https://opencollective.com/nodemon/donate

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@vue/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

@vue/[email protected]
added 668 packages from 500 contributors in 42.29s

What is expected?

vue-cli installed

What is actually happening?

Vue seems installed but with the errors above

Most helpful comment

Solved with sudo npm install -g @vue/cli --unsafe-perm

All 31 comments

Same here on Windows 10

Same here on Windows 10 too

Similar error on Windows 10:

> npm install -g @vue/cli
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm ERR! code ETARGET
npm ERR! notarget No matching version found for apollo-link@^1.2.7
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'apollo-link-context'
npm ERR! notarget

@benlove This is a different problem I believe it was already fixed as [email protected] is present on npm now https://www.npmjs.com/package/apollo-link

For Windows users: this is the expected behavior. fsevents is a macOS-only package, that's why it's an optional dependency.

@sodatea seeing a bunch of warnings and errors doesn't give the impression of a successful install though? How come my install on macOS skipped the optional fsevents?

@GeertClaes Sorry but I cannot reproduce this issue on my Mac. Maybe it's a npm or node-pre-gyp bug.

@sodatea maybe it's node/npm version issue? What version node/npm do you have? I found an older article where something similar happened: https://forum.vuejs.org/t/issues-installing-vue-cli/53167

@GeertClaes I'm using the exact same versions as yours…

  System:
    OS: macOS 10.14.2
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
  Binaries:
    Node: 10.15.1 - ~/n/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - ~/n/bin/npm

Cleared the entire node and npm again, added myself to wheel and staff groups and ran this: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share before installing again without errors

Solved with sudo npm install -g @vue/cli --unsafe-perm

Solved with sudo npm install -g @vue/cli --unsafe-perm

Thanks. It dose work.

Solved with sudo npm install -g @vue/cli --unsafe-perm

Thanks, It also worked for me.

thanks works for me

Solved with sudo npm install -g @vue/cli --unsafe-perm

thanks :)

RickdeMacBook-Pro:~ Rick$ sudo npm install -g @vue/cli --unsafe-perm

npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/Cellar/node/10.12.0/bin/vue -> /usr/local/Cellar/node/10.12.0/lib/node_modules/@vue/cli/bin/vue.js
npm WARN [email protected] requires a peer of typescript@>=2.0 but none is installed. You must install peer dependencies yourself.

  • @vue/[email protected]
    updated 1 package in 380.888s
    RickdeMacBook-Pro:~ Rick$ vue -v
    -bash: vue: command not found

sudo npm install -g @vue/cli --unsafe-perm did't solve my problem

Finally, I solved with

sudo npm install -g @vue/cli --unsafe-perm

Now its work on my iMac

Solved with sudo npm install -g @vue/cli --unsafe-perm

Wow! Huge thanks to you, it solved my problem :)

sudo npm install -g @vue/cli --unsafe-perm

Solved for me too. thank you!

For me it worked withnpm install -g @vue/cli@latest .
Now i have ERRORS when i try to create with : sudo vue create client .
Can anyone help me with this one?

@TodeDragos https://cli.vuejs.org/guide/troubleshooting.html#running-installation-with-sudo-or-as-root
In short: don't use sudo.

the problem was with the FOLDER of my project. It was created with some "root" permisions and because of that the sudo vue create client didn't worked.
Solution: i've created another folder/project and it worked fine without the sudo parameter.

Finally, I solved with

sudo npm install -g @vue/cli --unsafe-perm

Worked like a charm!

Solved with sudo npm install -g @vue/cli --unsafe-perm

Solved for me too. thank you!

Solved with sudo npm install -g @vue/cli --unsafe-perm

Thank you!

sudo npm install -g @vue/cli --unsafe-perm.
Perfecto. Gracias!!

best solution sudo npm install -g @vue/cli --unsafe-perm.
on mac pc

I keep getting these errors I tried 'sudo npm install -g @vue/cli --unsafe-perm' and it still gives me the following errors.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/omarzoghayyer/npm-global/lib/node_modules/@vue/cli/node_modules/fsevents
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@vue/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

Solved with sudo npm install -g @vue/cli --unsafe-perm

thanks for your help :)

Im getting almost the same problem here on Mac

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgribonvald picture jgribonvald  Â·  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  Â·  3Comments

chasegiunta picture chasegiunta  Â·  3Comments

miyamoto-san picture miyamoto-san  Â·  3Comments

brandon93s picture brandon93s  Â·  3Comments