Vuex: vue-cli vuex "refusing to install vuex as dependency of itself"

Created on 2 Apr 2016  路  9Comments  路  Source: vuejs/vuex

Any ideas? Just trying out VueX... Trying to learn this stuff...

Most helpful comment

Haha I've done that before, no worries it's a mistake anyone could make. Perhaps we can add a check in cli. With a warning Project name conflicts with a prexisting npm package, this could cause undesired effects.

All 9 comments

You're most likely doing npm install vuex in the wrong directory.

@yyx990803 Root directory of project is incorrect?

npm install vuex --save

This repo is the source code for vuex... you install vuex in other projects to use it.

@yyx990803 I don't think you're understanding the context of the problem. The NPM install command throws:

refusing to install vuex as dependency of itself

This command is run in the root directory of the webpack project.

I don't think you provided enough context. This would only happen if you are installing vuex inside a directory where vuex's package.json is present, so there must be something wrong with your project setup.

@yyx990803 Thanks for the clarification. The project was actually generated by the vue-cli npm package. And is the standard webpack template.

@yyx990803 OMG, I figured it out. I named the project "vuex". Even though it was not the vuex repository.

So sorry for wasting your time.

Haha I've done that before, no worries it's a mistake anyone could make. Perhaps we can add a check in cli. With a warning Project name conflicts with a prexisting npm package, this could cause undesired effects.

open file package.json and change package name

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fnlctrl picture fnlctrl  路  4Comments

gdelazzari picture gdelazzari  路  3Comments

jbruni picture jbruni  路  3Comments

ijse picture ijse  路  3Comments

taoeffect picture taoeffect  路  3Comments