Search code examples
vuexnuxt.js

No store/index.js file in nuxt project


I make first steps in nuxtjs ander after creation of a new project I found only store/README.md file in store subdirectory, but not store/index.js file as I expected

Here https://nuxtjs.org/guide/vuex-store I read :

We don't need to install vuex since it's shipped with Nuxt.js.

I wonder can I to add vuex to my manually and how?

I tried next successfull command :

 npm install --save vuex
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})                                                                           

+ [email protected]                                                                                                                                                                                                                                 
updated 1 package and audited 10468 packages in 7.48s                                                                                                                                                                                        
found 0 vulnerabilities                                   

But now file store/index.js anyway? Which is the right way?

Thanks!


Solution

  • After recreating project I found that axios was not added to my project(but I added in wizard). Also there were store, despite what I read in docs, so I had ro run :

    npm install @nuxtjs/axios
    ...
    npm install --save store
    

    it works for me.