Nuxt.js: Nuxt generate missing dependency `node-fetch@^2.5.0`

Created on 14 May 2019  ยท  4Comments  ยท  Source: nuxt/nuxt.js

Version

v2.7.0

Reproduction link

https://app.netlify.com/sites/bootstrap-vue/deploys/5cdab75508cf930008ed8019

Steps to reproduce

Running nuxt generate produces the following error output (using 2.7.0 release)

9:41:58 AM: Executing user command: yarn docs-gen
9:41:59 AM: yarn run v1.3.2
9:41:59 AM: $ cross-env NODE_ENV=docs nuxt generate -c docs/nuxt.config.js
9:42:02 AM: 12:42:02 โ„น Production build
9:42:02 AM: 12:42:02  WARN  node-fetch@^2.5.0 is required but [email protected] is installed!
9:42:02 AM: 12:42:02  ERROR  Please install missing dependencies:
9:42:02 AM:  Using yarn:
9:42:02 AM:  yarn add node-fetch@^2.5.0
9:42:02 AM:  Using npm:
9:42:02 AM:  npm i node-fetch@^2.5.0
9:42:02 AM: 12:42:02  FATAL  Missing App Dependencies
9:42:02 AM:   at Builder.validateTemplate (node_modules/@nuxt/builder/dist/builder.js:5645:13)
9:42:02 AM:   at Builder.build (node_modules/@nuxt/builder/dist/builder.js:5553:12)
9:42:02 AM:   at <anonymous>
9:42:02 AM:    โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
9:42:02 AM:    โ”‚                                     โ”‚
9:42:02 AM:    โ”‚   โœ– Nuxt Fatal Error                โ”‚
9:42:02 AM:    โ”‚                                     โ”‚
9:42:02 AM:    โ”‚   Error: Missing App Dependencies   โ”‚
9:42:02 AM:    โ”‚                                     โ”‚
9:42:02 AM:    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
9:42:02 AM: error Command failed with exit code 1.
9:42:02 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is expected ?

Nuxt generate would work

What is actually happening?

Fatal error missing correct dependency

Additional comments?

You may need to update your dep versions

This bug report is available on Nuxt community (#c9210)
available soon bug-report

Most helpful comment

@tmorehouse unfortunately probably from a sub-dep hoisted by the package manager. Cleaning up yarn.lock prevents such issues.

All 4 comments

As the error says, the installed version of node-fetch is not recommended one and solution is yarn add --dev node-fetch@^2.5.0. Meanwhile, I've created #5723 to convert it to a warning.

Although node-fetch is not one of our dependencies, so not sure where that one is coming from.

@tmorehouse unfortunately probably from a sub-dep hoisted by the package manager. Cleaning up yarn.lock prevents such issues.

shipped in v2.7.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shyamchandranmec picture shyamchandranmec  ยท  3Comments

gary149 picture gary149  ยท  3Comments

VincentLoy picture VincentLoy  ยท  3Comments

vadimsg picture vadimsg  ยท  3Comments

o-alexandrov picture o-alexandrov  ยท  3Comments