Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't run vue cli in Ubuntu - Error: Unable to access jarfile /snap/vue/1/jar/vue-1.0-SNAPSHOT.jar

I am trying to install vue cli for the first time.

I tried using npm install -g @vue/cli and yarn global add @vue/cli and it seems to install correctly.

But if I run vue create my-project or vue --version, I get the following error:

Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
Error: Unable to access jarfile /snap/vue/1/jar/vue-1.0-SNAPSHOT.jar

My operative system is Ubuntu.

like image 410
Willy Carrera Avatar asked Apr 08 '20 15:04

Willy Carrera


3 Answers

I had the same problem, to solve:

  1. Remove the vue using snap
sudo snap remove vue
  1. Then install vue globally via npm or yarn
npm install -g @vue/cli

OR

yarn global add @vue/cli
like image 95
Gousro Avatar answered Oct 19 '22 07:10

Gousro


I had the same problem as mentioned but it's due to me not giving administrator privilege to the installation. Therefore, I had to give an administrator privilege to the installation by typing:

sudo npm install -g @vue/cli

Then when I need to create the Vue project I type

sudo vue create <project_name>

and it works fine.

like image 6
Saonan Thy Avatar answered Oct 19 '22 07:10

Saonan Thy


I used these commands:

sudo snap remove vue
sudo npm install -g @vue/cli

Then created the Vue project:

sudo vue create <project_name>
like image 2
Berkay Nayman Avatar answered Oct 19 '22 07:10

Berkay Nayman