node-inspector / v8-debug

v8 debugger extending API
BSD 2-Clause "Simplified" License
45 stars 21 forks source link

ERROR on opening 'node-inspector' #18

Open MathijsvVelde opened 8 years ago

MathijsvVelde commented 8 years ago

When I open node-inspector in the browser, I immediately get this error through the browser's console:

Error: Cannot find module '/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.5.4/node-v46-darwin-x64/debug.node'

And there are no error thrown to the terminal.

I searched for the file and the closest match is '.../node-v47-darwin-x64/debug.node' Your file, your issue? Or should I submit this issue to the 'node-inspector' module?

cudasteve commented 8 years ago

Same issue here except that my node-inspector is as a dependency of gulp-node-inspector.

Was working previously with node 0.12. Now on node 4.2.2. Did npm install. Files on disk have v8-debug/build/debug/v0.5.4/node-v14-linux-x64/debug.node but not the v46 it's apparently looking for.

My versions of the various libraries involved:

3y3 commented 8 years ago

npm install doesn't helpful here. Try:

npm uninstall -g node-inspector
npm i -g node-inspector

The trick is to completely delete v8-debug and v8-profiler folders from node-inspector project, because you need to recompile their containment. There is some other ways to fix this problem, but this one is most simple.

I recommend you to don't use node without nvm. nvm make it simple to recompile global modules after node version change.

cudasteve commented 8 years ago

@3y3 Thanks! That seemed to do it.

Thanks for the tip on nvm. I do use it on my host machine, but this was happening inside a vagrant vm that gets rebuilt from scratch whenever we upgrade. Though since that's the case, I'm not exactly sure why it didn't work the first time. ¯_(ツ)_/¯

MathijsvVelde commented 8 years ago

@3y3, it didn't work on my side :disappointed: But I use it within my electron project and according to this tutorial doc electron has some stuff to fix before we can use node-inspector with electron

I did came across some errors (re)installing node-inspector. Some stuff to look in to!! :v:

$ sudo npm uninstall -g node-inspector
$ sudo npm install -g node-inspector
npm WARN deprecated lodash@2.4.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN lifecycle v8-debug@0.7.0~preinstall: cannot run in wd %s %s (wd=%s) v8-debug@0.7.0 node -e 'process.exit(0)' /usr/local/lib/node_modules/.staging/v8-debug-d56ef3c156d39eeb44cda4964e0a85c5
npm WARN lifecycle v8-profiler@5.5.0~preinstall: cannot run in wd %s %s (wd=%s) v8-profiler@5.5.0 node -e 'process.exit(0)' /usr/local/lib/node_modules/.staging/v8-profiler-700a09d0cc4475efe8f794ecb7f798e3
/usr/local/bin/node-inspector -> /usr/local/lib/node_modules/node-inspector/bin/inspector.js
/usr/local/bin/node-debug -> /usr/local/lib/node_modules/node-inspector/bin/node-debug.js

> bufferutil@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/bufferutil
> node-gyp rebuild

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node

> utf-8-validate@1.2.1 install /usr/local/lib/node_modules/node-inspector/node_modules/utf-8-validate
> node-gyp rebuild

  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node

> v8-debug@0.7.0 install /usr/local/lib/node_modules/node-inspector/node_modules/v8-debug
> node-pre-gyp install --fallback-to-build

[v8-debug] Success: "/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.7.0/node-v47-darwin-x64/debug.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> v8-profiler@5.5.0 install /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build

[v8-profiler] Success: "/usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.5.0/node-v47-darwin-x64/profiler.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
/usr/local/lib
└─┬ node-inspector@0.12.5 
  ├── async@0.9.2 
...
cudasteve commented 8 years ago

Encountered the same issue when rebuilding for node v5. Uninstalling and reinstalling node-inspector worked again, so not really a big issue. Just confused as to why the original npm install doesn't seem to get it right but this does:

npm install
cd node_modules/gulp-node-inspector
npm uninstall node-inspector
npm install node-inspector