Installing vue-cli with Yarn

FYI, I’m only starting out too, this post just delivers the topic “Installing vue-cli with Yarn”, and it’s not working out of the box as of 2016-11-02. See issue. It will be fixed very soon.

No comparisons, no introductions, and other bullshit involved.

Just checking out vue.js and saw that it provides a cli tool to scaffold projects, Just wondering, why not just use yo generator? And I found this issue, saying

The main reason is that vue-cli makes it easier to just fork one of the official templates and create your own tailored template. […]

The other factor is branding. vue init just feels better than yo vue 😉

So for the sake of feeling better… I guess?

Table of Contents

Step 1: Install yarn

Yarn in a few words:

Fucking faster than npm! Ah! And from Facebook!

For those that are interested, here’s the post from Facebook – Yarn: A new package manager for JavaScript.

npm install -g yarn

Step 2: Install vue-cli

Yarn uses the command add to install. After each install, remove, operation… yarn prints out how much time it used. (Just to tell you how awesome it is!?)

yarn global add vue-cli

Issues (2016-11-02 vue-cli version 2.4.0)

FIXED in 2.4.1 >> See Pull Request

vue-init(1) does not exist, try --help

If you happen to see this after you install vue-cli with yarn, the fastest/easiest way to use this thingy is to install it with npm (lol~ no idea why i wrote this post now).

npm install -g vue-cli

If you still want to use yarn, the problem can be fixed by updating the version and bin in package.json for vue-cli. Usually located in /home/.yarn-config/global/node_modules/vue-cli and then run

yarn global add file:/path/to/vue-cli

yarn-2

yarn-3

Step 3: Create project with vue-cli

Last but not least, create a project and all is well~

vue init webpack my-project
Share
  • Copied the URL !

Comments

To comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Table of Contents