2

I was trying to install vue-cli using

npm install -g @vue/cli

I get the following error

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/moeketsi/.npm/_cacache/tmp'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!  /home/moeketsi/.npm/_logs/2019-08-02T07_16_39_683Z-debug.log

The log file is available here.

When i try running the command with sudo I get

sudo: npm: command not found

I'm using node v10.16.1 and npm vesrsion is 6.9.0 . I installed node.js from their website. I tried the following suggestions from this post and from maybe a slightly different case, none of the suggestions helped.

Miguel
  • 778
  • 4
  • 19

2 Answers2

4

According to the documentation you might have issues if you have previous versions installed. You can check all the packages installed with npm list -g.

To uninstall previous versions of vue-cli use npm uninstall vue-cli -g

If this is not the case you can try running npm cache clear --force and try to install it again.

Miguel
  • 778
  • 4
  • 19
2

This is the Issue of permission . Go to the root and try to install.

Try from root user :

sudo -i

npm install -g @vue/cli

If u want to maintain current directory.

sudo -s

npm install -g @vue/cli
Akj
  • 6,086
  • 3
  • 23
  • 33