During development I used to WebStorm node_path =.
environment variable. I have set up a variable in the launch of the project settings. Now I
I would recommend setting the variable right before you run the command like so:
NODE_PATH=src/ node myapp.js
This way the variable is set when needed. This is preferable unless you really need to change the path with different versions of your deployment.
If on windows, you can use this lil package to get the effect to work so it is consistent across dev and prod: win-node-env
For bonus points add it to your start script in package.json
like so:
"scripts": {
"start": "NODE_PATH=src/ node myapp.js"
}
Then in production all you need to do is run: npm start