Any ideas? Just trying out VueX... Trying to learn this stuff...
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
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.