3

I am playing with pkg to package a command line example I got from a blog post. The executable created fine but when I try to run the executable, I am getting the following error:

pkg/prelude/bootstrap.js:1244
      throw error;
      ^

Error [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
    at inspector.js:24:9
    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:276:7)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:218:10)
    at loadNativeModule (internal/modules/cjs/helpers.js:25:9)
    at Function.Module._load (internal/modules/cjs/loader.js:906:15)
    at Module.require (internal/modules/cjs/loader.js:1087:19)
    at Module.require (pkg/prelude/bootstrap.js:1225:31)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/snapshot/ginit/lib/repo.js:11:17)
    at Module._compile (pkg/prelude/bootstrap.js:1320:22) {
  code: 'ERR_INSPECTOR_NOT_AVAILABLE'
}

I put the package on github and here is the link: Link to github

Any help is greatly apprecited on how to get this to work.

Bill
  • 512
  • 4
  • 14

1 Answers1

0

This Error comes up when we try to Start the executable in DEBUG mode.

Since pkg doesn't allow Inspecting the run-time code of the executable this error Inspector is not available shows up.

I was trying to spawn the executable from another program (which was running in DEBUG mode) and it caused the same issue. But when I started the program in normal mode, it worked like a charm

  • Hi, facing the same problem. You said "when I started the program in normal mode, it worked like a charm". How do you invoke this "normal" mode exactly (example?). $NODE_OPTIONS is empty in my environment so no "debug" is set. I would really appreciate step-by-step instructions. Thanks! – blitter Jul 11 '22 at 12:10
  • By 'normal' mode, I meant 'not debug' mode. Are you sure you are running the program in 'non-debug' mode? –  Jul 22 '22 at 04:07