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

npm prune --production deletes axios dependency #568

Open
dschreij opened this issue Mar 8, 2022 · 0 comments
Open

npm prune --production deletes axios dependency #568

dschreij opened this issue Mar 8, 2022 · 0 comments

Comments

@dschreij
Copy link

dschreij commented Mar 8, 2022

We have an app using @nuxtjs/axios 5.13.6 and nuxt 2.15.8. This works fine in dev mode, and when building for production. If we call npm prune --production after the build operation has completed, the production build no longer works and prints the error:

 ERROR  Cannot find module 'axios' from '/frontend/packages/website'                    16:34:25

  at Function.resolveSync [as sync] (/frontend/node_modules/resolve/lib/sync.js:111:15)
  at /home/daniel/git/cargoplot/frontend/node_modules/vue-server-renderer/build.prod.js:1:77905
  at Object.<anonymous> (webpack:/external "axios":1:0)
  at __webpack_require__ (webpack/bootstrap:25:0)
  at Module.<anonymous> (server.js:23239:23)
  at __webpack_require__ (webpack/bootstrap:25:0)
  at updateModules (.nuxt/store.js:18:0)
  at Module.<anonymous> (.nuxt/store.js:23:0)
  at __webpack_require__ (webpack/bootstrap:25:0)
  at Object.<anonymous> (server.js:15281:18)
  at __webpack_require__ (webpack/bootstrap:25:0)
  at server.js:118:18
  at Object.<anonymous> (server.js:121:10)
  at o (/frontend/node_modules/vue-server-renderer/build.prod.js:1:77799)
  at /frontend/node_modules/vue-server-renderer/build.prod.js:1:78392
  at new Promise (<anonymous>)

so it appears as if the axios dependency is removed by the prune operation. If we add axios as a direct dependency to package.json it doesn't happen anymore, but we would like @nuxtjs/axios to specify and determine the axios version that is to be used. I don't remember when this issue started popping up, but is it due to a recent change of @nuxtjs/axios? Is axios now listed as a peer dependency instead of a direct dependency perhaps?

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

No branches or pull requests

1 participant