gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

ERR_INSPECTOR_NOT_AVAILABLE with `gatsby develop` #35225

Closed christopher-besch closed 2 years ago

christopher-besch commented 2 years ago

I'm using a basic example site.

When running gatsby develop I get this error.

~/dwn/gatsby-example-site λ ./node_modules/.bin/gatsby develop
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module '@mdx-js/mdx'
Require stack:
- /home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js
- /home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/renderer/index.js
- /home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/validate-steps.js
- /home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/recipe-machine/index.js
- /home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/graphql-server/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js:12:35)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/transform-recipe-mdx.js',
    '/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/renderer/index.js',
    '/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/validate-steps.js',
    '/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/recipe-machine/index.js',
    '/home/chris/dwn/gatsby-example-site/node_modules/gatsby-recipes/dist/graphql-server/server.js'
  ]
}

/home/chris/dwn/gatsby-example-site/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
    at inspector.js:25:9
    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:286:7)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:226:10)
    at loadNativeModule (internal/modules/cjs/helpers.js:39:9)
    at Function.Module._load (internal/modules/cjs/loader.js:760:15)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/chris/dwn/gatsby-example-site/node_modules/gatsby/src/commands/develop-process.ts:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) {
  code: 'ERR_INSPECTOR_NOT_AVAILABLE'
}

Apparently some node inspector is missing, but installing it explicitly using yarn add node-inspector fails like this:

error /home/chris/dwn/gatsby-example-site/node_modules/v8-debug: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /home/chris/dwn/gatsby-example-site/node_modules/v8-debug
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@14.17.6 | linux | x64
node-pre-gyp info check checked for "/home/chris/dwn/gatsby-example-site/node_modules/v8-debug/build/debug/v1.0.1/node-v83-linux-x64/debug.node" (not found)
node-pre-gyp http GET https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v83-linux-x64.tar.gz
node-pre-gyp http 404 https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v83-linux-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v83-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug@1.0.1 and node@14.17.6 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)

node-pre-gyp http 404 status code downloading tarball https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v83-linux-x64.tar.gz
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/chris/dwn/gatsby-example-site/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
node-pre-gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)
node-pre-gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
node-pre-gyp ERR! System Linux 5.15.23-gentoo-x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/chris/dwn/gatsby-example-site/node_modules/v8-debug/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/chris/dwn/gatsby-example-site/node_modules/v8-debug
node-pre-gyp ERR! node -v v14.17.6
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)

Here the installation of node-pre-gyp fails because of a 404 when fetching binaries and/or source code from AWS.

I've tested this with Manjaro and Gentoo Linux. It only fails on Gentoo (I've tested multiple machines).

As this issue didn't occur when installing gatsby's dependencies using yarn install, I'm opening an issue here first. If you don't have any blinding insight on how to fix this, I'll open one for node-pre-gyp.

Environment

System:
    OS: Linux 5.15 Gentoo/Linux
    CPU: (4) x64 Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 14.17.6 - /usr/bin/node
    Yarn: 1.22.17 - /usr/bin/yarn
    npm: 6.14.15 - /usr/bin/npm
  Languages:
    Python: 3.9.9 - /usr/bin/python
  npmPackages:
    gatsby: ^2.24.54 => 2.24.54
    gatsby-image: ^2.4.17 => 2.4.17
    gatsby-plugin-manifest: ^2.4.28 => 2.4.28
    gatsby-plugin-offline: ^3.2.27 => 3.2.27
    gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10
    gatsby-plugin-sharp: ^2.6.32 => 2.6.32
    gatsby-plugin-styled-components: ^3.3.11 => 3.3.11
    gatsby-source-filesystem: ^2.3.28 => 2.3.28
    gatsby-transformer-sharp: ^2.5.14 => 2.5.14
christopher-besch commented 2 years ago

One more search later: Screenshot 2022-03-25 at 21-03-55 node-pre-gyp

So this seems to be an issue with node-inspector? But why only for Gentoo? And why does it not fail when installing gatsby?