I work on a mean.js application (on top of express.js > node.js). I succeed to debug it locally (on kubuntu) with node inspector, no problem. But I fail to debug it remotely (from an ubuntu server) , after I pushed my app on the network.
I get this error on the devtools console:
Page.getResourceContent failed. Error: ENOENT, open '/home/remi/publisher-server/server.js' Error: Cannot find module '/usr/lib/node_modules/node-inspector/lib/InjectorServer.js'
But the server.js
's file permissions are 775
, and are owned by me.
If you look at this screenshot you can see that the browser access to all files tree and contents:
However, if you look at that one, you'll see that only the server.js
seems unreadable (content tab is empty):
Here are the steps I follow:
I login my server with this ssh options to redirect the5858
port
ssh -L 5858:localhost:5858 my-remote-host
From the ssh session I run the app with --debug
option:
$ cd ~/publisher-server
$ node --debug server.js
debugger listening on port 5858
Application loaded using the "development" environment configuration
MEAN.JS application started on port 3000
From my laptop I run :
$ node-inspector
Node Inspector v0.10.1
Visit http://127.0.0.1:8080/debug?ws=127.0.0.1:8080&port=5858 to start debugging.
Cannot resolve real path of /home/remi/publisher-server/server.js: Error: ENOENT, lstat '/home/remi/publisher-server'
You can notice the last line that throw the error that I found again in the devtools console when I finally browse http://127.0.0.1:8080/debug?ws=127.0.0.1:8080&port=5858
:
Page.getResourceContent failed. Error: ENOENT, open '/home/remi/publisher-server/server.js' Error: Cannot find module '/usr/lib/node_modules/node-inspector/lib/InjectorServer.js'
This makes me a bit crazy, what I'm making wrong ?