Skip to content

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

@AnnanFay

Description

@AnnanFay

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\""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions