I am trying to manage a remote project locally in WebStorm. I will run through a few configuration settings with their output and hope that someone can help me understand what is going on and how to fix some of the errors...
Here are, in general, my Run/Debug Configuration settings
Node Interpreter : ssh://me@server:22/remote/path/to/node/bin
Working Directory : /local/dir/with/node/project
Path Mappings : <Project Root> -> /remote/dir/with/node/project
/local/dir/with/node/project and /remote/dir/with/node/project are the same project on a shared directory.
When I run a simple .js script (just console.log('hello world');) in the project I get this in the debugger...
Error: Cannot find module '/remote/dir/with/node/project'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
Process finished with exit code 1
If I change Path Mappings to /remote/dir/with/node/project/test.js the program actually runs! But this shows up in the console...
bash: line 0: cd:/remote/dir/with/node/project/test.js: Not a directory
Process finished with exit code 0
So the cd in bash doesn't work but the script does. Is my path mapping wrong? How do I fix this?