Error when using npm and running develop scripts
JoschuaSchneider opened this issue · 1 comments
Bug Report
Current Behavior
Upon running npm run develop
, gatsby exits with a Webpack Error:
info bootstrap finished - 2.231 s
error There was an error compiling the html.js component for the development server.
See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html
WebpackError: Cannot find module 'core-js/modules/es6.object.assign'
Reproducible demo
Cleanly clone the repo, npm install dependencies, run npm run develop
Expected behavior/code
Gatsby should start the development server without any errors.
Possible Solution
As pointed out in an issue over at the gatsby repo Error: Cannot find module 'core-js/modules/es6.object.assign', upgrading the gatsby dependency fixes the issue.
Upgrading gatsby also fixed the issue for me.
Additional context/Screenshots
I was using NPM when encountering this problem. For NPM, either upgrading gatsby or installing core-js@2 fixed the issue for me.
For anybody having this problem, using yarn (which should have been obvious seeing the yarn.lock
file) fixes the problem.
When running with NPM, there probably is some package missing thats covered by the yarn lockfile.