Search code examples
linuxnode.jsnpmnvmnode-debugger

Node-debug broken after upgrading node via nvm


I just upgrade node from v0.12.2 to v5.10.1 and node-debug appears to be broken for me.

When I run:

node-debug bin/www

I get the following error in Chrome:

Error: Cannot find module '/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v47-linux-x64/debug.node'

I don't have a node-v47-linux-x64 directory but I do have a node-v14-linux-x64 directory.

node -v
v5.10.1

npm -v
3.8.3

Any suggestions on how to fix this?


Solution

  • Clear npm cache and reinstalling modules seemed to work. I reinstalled some modules globally (node-inspector...)

    npm cache clear
    npm install
    

    The problem appears to be with me using nvm.

    (note, global modules need to be reinstalled in each node version, including your system one, or they are not likely to work properly)