gatsby: [v2] New Project: Error: Module build failed: BrowserslistError: Unknown browser query `dead`
Description
After creating a new project Running gatsby develop
causes the error Error: Module build failed: BrowserslistError: Unknown browser query 'dead'
.
Related: #6694
Steps to reproduce
nvm use --lts
gatsby new example-public
cd example-public
gatsby develop
Expected result
Site should be available on Localhost
Actual result
Error in console:
Error: Module build failed: BrowserslistError: Unknown browser query `dead` (While processing preset: "/Users/me/Sites/example-public/node_modules/babel-preset-env/lib/index.js")
- index.js:164
[example-public]/[browserslist]/index.js:164:11
- Array.reduce
- index.js:132 resolve
[example-public]/[browserslist]/index.js:132:18
- index.js:224 browserslist
[example-public]/[browserslist]/index.js:224:16
- targets-parser.js:103 getTargets
[example-public]/[babel-preset-env]/lib/targets-parser.js:103:63
- index.js:144 buildPreset
[example-public]/[babel-preset-env]/lib/index.js:144:45
- option-manager.js:317
[example-public]/[babel-core]/lib/transformation/file/options/option-manager.js:317:46
- Array.map
- option-manager.js:275 OptionManager.resolvePresets
[example-public]/[babel-core]/lib/transformation/file/options/option-manager.js:275:20
- option-manager.js:264 OptionManager.mergePresets
[example-public]/[babel-core]/lib/transformation/file/options/option-manager.js:264:10
- option-manager.js:249 OptionManager.mergeOptions
[example-public]/[babel-core]/lib/transformation/file/options/option-manager.js:249:14
- option-manager.js:368 OptionManager.init
[example-public]/[babel-core]/lib/transformation/file/options/option-manager.js:368:12
- index.js:212 File.initOptions
[example-public]/[babel-core]/lib/transformation/file/index.js:212:65
- index.js:135 new File
[example-public]/[babel-core]/lib/transformation/file/index.js:135:24
- pipeline.js:46 Pipeline.transform
[example-public]/[babel-core]/lib/transformation/pipeline.js:46:16
- index.js:46 transpile
[example-public]/[babel-loader]/lib/index.js:46:20
- fs-cache.js:79
[example-public]/[babel-loader]/lib/fs-cache.js:79:18
- fs-cache.js:15 ReadFileContext.callback
[example-public]/[babel-loader]/lib/fs-cache.js:15:14
Environment
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5575R CPU @ 2.80GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
Browsers:
Chrome: 68.0.3440.84
Safari: 11.1.2
npmPackages:
gatsby: ^1.9.277 => 1.9.277
gatsby-link: ^1.6.46 => 1.6.46
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
npmGlobalPackages:
gatsby-cli: 2.0.0-beta.12
File contents (if changed)
gatsby-config.js
: N/A
package.json
: N/A
gatsby-node.js
: N/A
gatsby-browser.js
: N/A
gatsby-ssr.js
: N/A
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 19 (7 by maintainers)
Globally I have gatsby
2.4.1
installed. For my project,^1.9.63
.$ node_modules/.bin/gatsby develop
works indefinitely for me, but it’s obviously not a long term solution. It’d be helpful to be able to run whatever version of gatsby is in package.json instead of the global one, as I have not migrated my project to v2, but would still like to start new projects with v2 from the global gatsby.I’m having the same issue when launching a ‘gatsby build’ I’m using gastby-starter-strava, how can i pass through the problem ?
Using node_modules/.bin/gatsby build … works. Using gatsby build (coming from a globally installed gatsby-cli) … fails with said error.
So for me, I have now removed installing gatsby-cli entirely and production builds now successfully build.
Looks like it’s been fixed in
2.4.2
. I’m able to just run$ gatsby build
again after updatinggatsby-cli
. See https://github.com/parmsang/gatsby-starter-ecommerce/issues/10%23issuecomment-425077715My build now passed, switched from yarn to npm, and downgraded node from 8.12 to 8.9.4 with npm 5.6.0
same deal as @5tormTrooper my local gatsby was 1.X and my global was 2.X downgrading to 1.X globally fixed the issue for me
it happend the same to me, when i updated locally my global gatsby-cli to v. 2.4.1.
Looks like this issue is breaking build systems that are still on Gatsby v1