tanepiper / SublimeText-Nodejs

nodejs snippets and bindings for Sublime Text 3
Do What The F*ck You Want To Public License
1.13k stars 262 forks source link

Spaces in path causes "Error: cannot find module" #88

Open AnnanFay opened 6 years ago

AnnanFay commented 6 years ago

If you try to build a file which has a space in the path to the file this causes an error. Only tested on Windows. In my case the error is:

Error: Cannot find module 'F:\Dropbox'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:193:16)
    at bootstrap_node.js:617:3

The filepath in this case being: "F:\Dropbox (Personal)\[...]\main.js"

I fixed the issue for myself by changing Nodejs.sublime-build to:

    "shell_cmd": "taskkill /F /IM node.exe & node \"$file\""
root-hal9000 commented 6 years ago

I am having the same problem ... sand sadly, dropbox is not very nice about being able to change the folder names