1

Each time I install/build my vue.js project from scratch (e.g. in a new/fresh git clone) I run:

npm install -g @vue/cli
npm install -g @vue/cli-service-global
npm install

Is is possible to move:

@vue/cli
@vue/cli-service-global

into my package.json file so they will get installed along side my other dependencies and I can just run:

npm install

to prepare my project?

Or are both:

@vue/cli
@vue/cli-service-global

"special" in the sense that they are not project specific dependencies but more like system wide tools like npm, node, git etc?

1 Answer 1

5

In your package.json under scripts you need to add preinstall script which will execute preinstall scripts every time you do npm install , as follow:

  "scripts": {
    "preinstall": "npm i -g @vue/cli @vue/cli-service-global"
  }

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.