For some reason finddir returns the full path on my system so getCwd() . finddir() causes the path to be /Users/user/path/to/project//Users/user/path/to/project/node_modules/.... I had to remove getCwd() calls from rescript#UpdateProjectEnv() and it all works. It's probably something about my setup but I cannot figure it out.