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

Build gives webpack error 98001. Generated engines use disallowed import "node-gyp-build" #34912

Closed
2 tasks done
john-sc opened this issue Feb 23, 2022 · 28 comments · Fixed by #35076
Closed
2 tasks done
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@john-sc
Copy link

john-sc commented Feb 23, 2022

Preliminary Checks

Description

Cloned from github.
gatsby new fg https://github.com/gatsbyjs/gatsby-starter-default
gatsby develop works fine.
gatsby build gives:
success load gatsby config - 0.023s
success load plugins - 0.641s
...
success Execute page configs - 0.029s
failed Validating Rendering Engines - 0.719s

ERROR #98001 WEBPACK

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at
https://github.com/gatsbyjs/gatsby/issues/new for more help

Error: Generated engines use disallowed import "node-gyp-build". Only allowed
imports are to Node.js builtin modules or engines internals.

  • child.ts:60 Function._module.default._load
    [fg]/[gatsby]/src/utils/validate-engines/child.ts:60:11

  • loader:1005 Module.require
    ...

Reproduction Link

https://github.com/gatsbyjs/gatsby-starter-default

Steps to Reproduce

  1. Clone the repository
  2. gatsby build

Expected Result

Expected the build to complete without error

Actual Result

Build webpack error 98001

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.6 - /usr/bin/python
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (98.0.1108.56)
  npmPackages:
    gatsby: ^4.8.0 => 4.8.0 
    gatsby-plugin-gatsby-cloud: ^4.8.0 => 4.8.0 
    gatsby-plugin-image: ^2.8.0 => 2.8.0 
    gatsby-plugin-manifest: ^4.8.0 => 4.8.0 
    gatsby-plugin-offline: ^5.8.0 => 5.8.0 
    gatsby-plugin-react-helmet: ^5.8.0 => 5.8.0 
    gatsby-plugin-sharp: ^4.8.0 => 4.8.0 
    gatsby-source-filesystem: ^4.8.0 => 4.8.0 
    gatsby-transformer-sharp: ^4.8.0 => 4.8.0 
  npmGlobalPackages:
    gatsby-cli: 4.8.0

Config Flags

It is unchanged from the repo

@john-sc john-sc added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 23, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 23, 2022
@tyhopp
Copy link
Contributor

tyhopp commented Feb 24, 2022

Hi @john-sc!

Sorry to hear you're running into an issue.

I wasn't able to reproduce this behavior with npx gatsby new default https://github.com/gatsbyjs/gatsby-starter-default, which should be equivalent since your global gatsby-cli is the latest version.

I'm on a Mac however, and I don't have a windows machine (virtual or otherwise) to try to reproduce on the same os. I'll check if someone with a windows machine can reproduce this, in the mean time can you verify this also happens with npx just to make sure there's no issue with your global gatsby-cli?

Thanks!

@tyhopp tyhopp added status: awaiting author response Additional information has been requested from the author and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 24, 2022
@sukantatoptal
Copy link

sukantatoptal commented Feb 24, 2022

@tyhopp
I am facing the same issue this only stared to happen from this morning ,

gatsby version "^4.0.0",

Windows System

image

@OlgaBertash
Copy link

I've faced the same error (Windows 11, Gatsby version: 4.8.0)

@sukantatoptal
Copy link

I've faced the same error (Windows 11, Gatsby version: 4.8.0)

Hi @OlgaBertash , were you able to solve this ?

@LekoArts LekoArts added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: awaiting author response Additional information has been requested from the author labels Feb 25, 2022
@msf97
Copy link

msf97 commented Feb 25, 2022

Same error
ERROR #98001 WEBPACK

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help

Error: Generated engines use disallowed import "node-gyp-build". Only allowed imports are to Node.js builtin modules o r engines internals.
failed Validating Rendering Engines - 1.344s

ERROR #98001 WEBPACK

Built Rendering Engines failed validation failed validation.
node:internal/modules/cjs/loader:1005:19
Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help

  • helpers:102 require

Error: Generated engines use disallowed import "node-gyp-build". Only allowed imports are to Node.js builtin modules or engines internals.
H:/gatsby/gw/.cache/query-engine/index.js:21648:20

  • child.ts:60 Function._module.default._load
    [gw]/[gatsby]/src/utils/validate-engines/child.ts:60:11
    ccess copy gatsby files - 0.345s

  • loader:1005 Module.requireions - 0.524s
    node:internal/modules/cjs/loader:1005:19
    ccess createSchemaCustomization - 0.009s

  • helpers:102 requireanged pages - 0.003s
    node:internal/modules/cjs/helpers:102:18
    ccess Building HTML renderer - 2.144s

  • index.js:21648 Object.defineProperty.value
    H:/gatsby/gw/.cache/query-engine/index.js:21648:20
    ==================== ] 9.973 s 3/4 75% Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs

  • index.js:350030 webpack_require
    H:/gatsby/gw/.cache/query-engine/index.js:350030:42
    ccess Building production JavaScript and CSS bundles - 1.391s

  • index.js:145469 Object.exports.__esModule
    H:/gatsby/gw/.cache/query-engine/index.js:145469:13g gatsby-plugin-sharp.IMAGE_PROCESSING jobs

  • index.js:350030 webpack_require
    H:/gatsby/gw/.cache/query-engine/index.js:350030:42
    t finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 64.159s

  • index.js:136486 Object.exports.__esModule
    H:/gatsby/gw/.cache/query-engine/index.js:136486:17
    \gatsby\gw>npm run build

  • index.js:350030 webpack_require
    H:/gatsby/gw/.cache/query-engine/index.js:350030:42
    gatsby build

  • index.js:136248 Object.
    H:/gatsby/gw/.cache/query-engine/index.js:136248:5

not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 11.393s

@LekoArts
Copy link
Contributor

Please post a minimal reproduction and/or give more information about your environment how we can reproduce this. Thanks!

@msf97
Copy link

msf97 commented Feb 25, 2022

Please post a minimal reproduction and/or give more information about your environment how we can reproduce this. Thanks!

with this:
gatsby new bug-repro https://github.com/gatsbyjs/gatsby-starter-minimal
I did not receive an error. and build successful!
when i use "gatsby new" I'm facing that error.

@donaldboulton
Copy link

donaldboulton commented Feb 26, 2022

Modules on Installation with yarn 3.2.0 shows node-gyp errors

have gotten errors on build with sharp once and imdb every time, this is with Gatsby 4.8.0, 4.7.2 does not give the installation or build errors. These errors do not happen using Gatsby develop.

`
➤ YN0032: │ sharp@npm:0.30.1: Implicit dependencies on node-gyp are discouraged

➤ YN0032: │ lmdb@npm:2.2.2: Implicit dependencies on node-gyp are discouraged

➤ YN0032: │ node-addon-api@npm:4.3.0: Implicit dependencies on node-gyp are discouraged

➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged

➤ YN0032: │ nan@npm:2.15.0: Implicit dependencies on node-gyp are discouraged`

I have noticed that You develop Gatsby on Apple computers because fs is used, which will not work on Windows. Test before production on Windows and try to figure out fs-extra.

@Hamzah-syed

This comment was marked as off-topic.

@donaldboulton
Copy link

Not fixed with clean install on 4.9.1

@wardpeet
Copy link
Contributor

wardpeet commented Mar 7, 2022

Can you try on gatsby@next?

@karnbibek

This comment was marked as off-topic.

@KhabeesInsaan
Copy link

I also got this issue when running gatsby build but not on gatsby develop. @karnbibek Can you please tell which other package version I have to change, these are the dependencies in my package.json:
"@fontsource/cinzel": "^4.5.0",
"@fontsource/eb-garamond": "^4.5.0",
"@fontsource/encode-sans-expanded": "^4.5.0",
"gatsby": "^4.9.0",
"gatsby-plugin-gatsby-cloud": "^4.9.0",
"gatsby-plugin-image": "^2.9.0",
"gatsby-plugin-manifest": "^4.9.0",
"gatsby-plugin-offline": "^5.9.0",
"gatsby-plugin-react-helmet": "^5.9.0",
"gatsby-plugin-sharp": "^4.9.0",
"gatsby-source-filesystem": "^4.9.0",
"gatsby-transformer-sharp": "^4.9.0",
"prop-types": "^15.8.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-icons": "^4.3.1",
"react-scroll": "^1.8.6",
"styled-components": "^5.3.3"

@karnbibek
Copy link

I also got this issue when running gatsby build but not on gatsby develop. @karnbibek Can you please tell which other package version I have to change, these are the dependencies in my package.json: "@fontsource/cinzel": "^4.5.0", "@fontsource/eb-garamond": "^4.5.0", "@fontsource/encode-sans-expanded": "^4.5.0", "gatsby": "^4.9.0", "gatsby-plugin-gatsby-cloud": "^4.9.0", "gatsby-plugin-image": "^2.9.0", "gatsby-plugin-manifest": "^4.9.0", "gatsby-plugin-offline": "^5.9.0", "gatsby-plugin-react-helmet": "^5.9.0", "gatsby-plugin-sharp": "^4.9.0", "gatsby-source-filesystem": "^4.9.0", "gatsby-transformer-sharp": "^4.9.0", "prop-types": "^15.8.0", "react": "^17.0.1", "react-dom": "^17.0.1", "react-helmet": "^6.1.0", "react-icons": "^4.3.1", "react-scroll": "^1.8.6", "styled-components": "^5.3.3"

Yes develop was working for me too. and I can see the "gatsby": "^4.9.0" which you can change to some older version and if any other issue comes changes other package version accordingly. (P.S. This is not the permanent fix)

@donaldboulton
Copy link

donaldboulton commented Mar 7, 2022

This is a gatsby-plugin-sharp error, on Linux it says the below

Error: Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp-linux-x64.node'
Require stack:

  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/sharp/lib/sharp.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/sharp/lib/constructor.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/sharp/lib/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby-plugin-sharp/safe-sharp.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby-plugin-sharp/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby-transformer-sharp/customize-schema.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby-transformer-sharp/gatsby-node.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/load-plugins/resolve-plugin.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/load-themes/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/load-config/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/services/initialize.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/services/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bootstrap/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/commands/build.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/dist/bin/gatsby.js
  • /media/donald/D66CD5576CD5334B/Users/User1/Documents/Github/publiuslogic.co
    m/node_modules/gatsby/cli.js
    Possible solutions:
  • Install with the --verbose flag and look for errors: "npm install --ignore-
    scripts=false --verbose sharp"
  • Install for the current linux-x64 runtime: "npm install --platform=linux --
    arch=x64 sharp"
  • Consult the installation documentation: https://sharp.pixelplumbing.com/ins
    tall

I have had gatsby-image and now gatsby-plugin-image errors so many times since v 2, I am tired of this non-sense and am going to next which keeps it plugins stable and tests production installations and build on different platforms. Which obviously Gatsby does not, its almost like you are trying to break things. Which puts me and your other users through hell. Most of your packages have outdated modules of which some have been outdated for 5 to 6 years and there are alternatives other npm modules to be used. Go through all plugins you have built and update them or you will keep seeing stupid errors with Gatsby and destroy your customer base. I do not really find any new posts lately on Gatsby anything, all the best programmers in the last year are going to rust or next. Even a lot of the people who build and maintain Gatsby there personal websites are not Gatsby.

P.S. If I send a new commit to Github - Nelify with the package-lock.json or yarn.lock, I get the above build error. If I send no lock files it builds, tell y'all anything.

@KhabeesInsaan

This comment was marked as off-topic.

@KhabeesInsaan

This comment was marked as off-topic.

@LekoArts
Copy link
Contributor

LekoArts commented Mar 8, 2022

Again, we need a minimal reproduction with clear instructions on what version and system to use. Otherwise we can't help. I've minimized comments that showed some package.json as it's not relevant to this issue.
Also, it doesn't help to make false claims about how we write or test code, our CI runs on Windows and we have people using it successfully on Windows. We want to help but y'all need to give us more information. Thanks!

@KhabeesInsaan
Copy link

@LekoArts Try using the git default starter, I did so and and it gave the same error.

@wardpeet
Copy link
Contributor

It should be fixed, can you make sure all dependencies are up to date? I'm going to close it for now but feel free to re-open.

@muscaiu
Copy link

muscaiu commented Jul 6, 2022

@wardpeet it's not fixed. I have the same issue: #36042

It happens on npm run build on every environment.

Screenshot 2022-07-06 at 15 09 52

@uuykay
Copy link

uuykay commented Aug 6, 2022

Chiming in to say it is happening to me as well. There's nothing in the logs that really hint at what's going wrong.

image

Some of my dependencies and versions:

    "gatsby": "^4.8.1",
    "gatsby-image": "^3.11.0",
    "gatsby-plugin-alias-imports": "^1.0.5",
    "gatsby-plugin-gtag": "^1.0.13",
    "gatsby-plugin-manifest": "^4.8.1",
    "gatsby-plugin-offline": "^5.8.1",
    "gatsby-plugin-react-helmet": "^5.8.0",
    "gatsby-plugin-robots-txt": "^1.7.0",
    "gatsby-plugin-sass": "^5.8.0",
    "gatsby-plugin-sharp": "^4.8.1",
    "gatsby-plugin-sitemap": "^5.8.0",
    "gatsby-plugin-typescript": "^4.8.1",
    "gatsby-source-filesystem": "^4.13.0",
    "gatsby-transformer-json": "^4.13.0",
    "gatsby-transformer-sharp": "^4.8.0",

@donaldboulton
Copy link

Gatsby 4.8.1 had issues update to the latest modules.
Gtag was giving me issues use Scripts API to use Google tags or partytown API

@uuykay
Copy link

uuykay commented Aug 10, 2022

Following up to say that I fixed it by updating my dependencies, this is my dependency list now:

    "gatsby": "^4.20.0",
    "gatsby-image": "^3.11.0",
    "gatsby-plugin-alias-imports": "^1.0.5",
    "gatsby-plugin-gtag": "^1.0.13",
    "gatsby-plugin-manifest": "^4.20.0",
    "gatsby-plugin-offline": "^5.20.0",
    "gatsby-plugin-react-helmet": "^5.20.0",
    "gatsby-plugin-robots-txt": "^1.7.1",
    "gatsby-plugin-sass": "^5.20.0",
    "gatsby-plugin-sharp": "^4.20.0",
    "gatsby-plugin-sitemap": "^5.20.0",
    "gatsby-plugin-typescript": "^4.20.0",
    "gatsby-source-filesystem": "^4.20.0",
    "gatsby-transformer-json": "^4.20.0",
    "gatsby-transformer-sharp": "^4.20.0",

@joernroeder
Copy link
Contributor

joernroeder commented Sep 8, 2022

I'm seeing the same but with canvas. Are there any tips on how I can debug this?

Error: Generated engines use disallowed import "canvas". Only allowed imports are to Node.js builtin modules or engines internals.

@hesta-inrsaurabh
Copy link

I am facing this issue.

image

It's working fine on develop server. Deployed to live linux server. Not getting the above error.

No more info is shown.Any suggestion where to look for more info on error

@hesta-inrsaurabh
Copy link

I am facing this issue.

image

It's working fine on develop server. Deployed to live linux server. Not getting the above error.

No more info is shown.Any suggestion where to look for more info on error

In development mode everything is working fine.

Only production build is failing.

@leandrocunha
Copy link

I am facing this issue.
image
It's working fine on develop server. Deployed to live linux server. Not getting the above error.
No more info is shown.Any suggestion where to look for more info on error

In development mode everything is working fine.

Only production build is failing.

I've got the same, did you solve that @hesta-inrsaurabh ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.