question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why are dev dependencies needed at runtime ?

See original GitHub issue

I’ve created a fresh new project today with npx create-nuxt-app xxx

It was impossible to deploy it to heroku. (It builded correctly but crashed on server start)

Multiple errors were thrown one after the other

  1. Error: Cannot find module 'vuetify/es5/util/colors' => solved by moving @nuxtjs/vuetify to dependencies
  2. Error: Cannot find module '@nuxtjs/eslint-module' => solved by moving @nuxtjs/eslint-module to dependencies
  3. Error: Cannot find module '@nuxtjs/stylelint-module' => solved by moving @nuxtjs/stylelint-module to dependencies

But those are bad fixes, those should stay in dev dependencies.

You can reproduce the error with the following steps :

npm install
npm run build
npm prune --production
npm run start

the options used for create-nuxt-app :

  • npm
  • Vuetify.js
  • Express
  • with all nuxt modules (axios, PWA support, dotenv)
  • with all linting tools (ESLint, Prettier, Lint staged files, StyleLint)
  • Jest
  • Universal
  • with jsconfig.json

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
pi0commented, Jan 4, 2021

@chrismooreproductions You need at least nuxt-start and typescript-runtime in dependencies. This is current nuxt2 limitation (we are working on new server engine that allows zero dependency deployments)

1reaction
existe-dejacommented, Nov 23, 2020

I’m reopenning this issue. With a fresh yarn create nuxt-app and yarn install --production I get this error:

ERROR in ./.nuxt/client.js
Module not found: Error: Can't resolve 'regenerator-runtime/runtime'
 @ ./.nuxt/client.js 24:0-37
 @ multi ./node_modules/@nuxt/components/lib/installComponents.js ./.nuxt/client.js

I should be able to install for production and start without problem. Please keep a clean package.json 🙏

edit: it’s vue-jest package who needs to be installed in production mode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Demystifying `devDependencies` and `dependencies`
Development dependencies, or devDependencies are packages that are consumed by requiring them in files or run as binaries, during the ...
Read more >
Difference between dependencies, devDependencies and ...
A dependency is a library that a project needs to function effectively. DevDependencies are the packages a developer needs during development. A ...
Read more >
NPMmmm #1: Dev Dependencies, Dependencies - Medium
The difference between these two, is that devDependencies are modules which are only required during development, while dependencies are modules which are also ......
Read more >
node.js - What's the difference between dependencies ...
devDependencies is not installed transitively. E.g. we don't need to test B to test A, so B's testing dependencies can be left out....
Read more >
Is this a dependency or devDependency? - With Blue Ink
dependencies : Packages required by your application in production. · devDependencies : Packages that are only needed for local development and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found