Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with nuxt generate #44

Closed
pstachula-dev opened this issue Jun 25, 2017 · 4 comments
Closed

Problem with nuxt generate #44

pstachula-dev opened this issue Jun 25, 2017 · 4 comments

Comments

@pstachula-dev
Copy link

pstachula-dev commented Jun 25, 2017

nuxt generate
[nuxt] Generating...
[nuxt] Unable to resolve module @nuxtjs/axios
{ Error: Cannot find module '@nuxtjs/axios'

This question is available on Nuxt.js community (#c14)
@pstachula-dev pstachula-dev changed the title Problem with nuxt generate and npm run build Problem with nuxt generate Jun 25, 2017
@pi0
Copy link
Member

pi0 commented Jun 25, 2017

Hey. Are you sure @nuxtjs/axios dependency is installed in package.json? Technically there shouldn't be any difference between generate and build.

@pstachula-dev
Copy link
Author

Yes dependency is installed, and when I run npm run dev it works, but when I run nuxt generate for production version I have an error.

@gdomiciano
Copy link

Hey Guys,
I've fixed it using @nuxt/axios as a dependency instead of a dev dependency in my package.json

So, now my package.json looks like:

"dependencies": {
    "@nuxtjs/axios": "^2.3.0",
    "@nuxtjs/proxy": "^1.1.1",
    "nuxt": "^1.0.0-alpha.4",
    "vue-loader": "^12.2.1",
    "vue-meta": "^1.0.4",
    "vue-router": "^2.5.3",
    "vue-ssr-html-stream": "^2.2.0",
    "vue-style-loader": "^2.0.0"
  },
  "devDependencies": {...},

instead of:

"dependencies": {
    "nuxt": "^1.0.0-alpha.4",
    "vue-loader": "^12.2.1",
    "vue-meta": "^1.0.4",
    "vue-router": "^2.5.3",
    "vue-ssr-html-stream": "^2.2.0",
    "vue-style-loader": "^2.0.0"
  },
  "devDependencies": {
    "@nuxtjs/axios": "^2.3.0",
    "@nuxtjs/proxy": "^1.1.1",
    ...
  },

@anteriovieira
Copy link
Member

Thanks @gdomiciano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants