'Error: Unable to access jarfile /snap/vue/1/jar/vue-1.0-SNAPSHOT.jar when creating vue.js project

I used below command to create new vue.js project.

sudo vue create my-app

but it gives 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

how i solve this error to create new vue.js project?

My operating system is 'Ubuntu'



Solution 1:[1]

I solved this problem. I did not grant administrator privileges for installation.Therefore, I just have to give Administrator Privilege to the installation by typing sudo npm install -g @vue/cli. Then when I need to create Vue Project I just type sudo vue create <project_name> then it works fine.

Solution 2:[2]

I solved with:

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kaumadie Kariyawasam
Solution 2 Eduardo Lemes