user2856066
user2856066

Reputation: 831

Cant create a vue project with CLI

This is probably because of my minor knowledge on terminal commands and filesystem on Mac OS but I have a really hard time to install a vuejs project.

First I tried to install with WebStorm 2018.1 and with the template for vue projects. I got on error pointing to permission problems.

After that I tried to install with vue init webpack (and sudo -i -u xxx vue init webpack) but got the error - Failed to download repo vuejs-templates/webpack: EPERM: operation not permitted, utime

After that I tried to install with sudo vue init webpack which installed all the files but with root user and I cant edit the files when I am logged in as a user (admin), the files are read only.

Thanks for any help.

Upvotes: 3

Views: 8479

Answers (3)

Ripal Barot
Ripal Barot

Reputation: 716

I had the same issue. In my case, the node version was 8.0. I upgraded to 10.0 and it worked.

  1. I removed all the node modules.
  2. Removed node 8.x and npm.
  3. Installed node 10.x and npm
  4. Install @vue/cli using the npm.

Upvotes: 0

user2856066
user2856066

Reputation: 831

I am not sure why but it works.

I removed the hidden folder vue-templates (under my user account)

Installed the cli again with sudo npm install -g vue-cli. I thought that I should have problem again because I used sudo, but not.

And then I was able to use vue init webpack voutest without sudo an all the files was editable and not readonly as before.

I also updated npm to 5.8.0

Upvotes: 2

ParthS007
ParthS007

Reputation: 2689

Please follow these commands:

To install the Vue CLI globally on your local system:

npm install -g vue-cli

To initiate a project

vue init webpack vueapp01

cd vueapp01

Start installing the dependencies by using npm again:

npm install

After having completed the installation of packages you can start the web server in development mode by using npm in the following way:

npm run dev

This will start the server on port 8080 and the application output is displayed in the browser automatically.

Upvotes: 4

Related Questions