I rarely deal with windows, so maybe I'm missing something. But I feel like I've tried most things that could reasonably be expected to work. This is all on the just-released v1.3.2.
I have an executable in C:\Users\Public\with spaces\node.exe, and I would like nodemon to run it. This is what happened:
This would be nice, but I don't expect it to work:
> node nodemon\bin\nodemon.js --exec "C:\Users\Public\with spaces\node.exe" -- -c console.log(1)
21 Jan 16:13:01 - [nodemon] v1.3.2
21 Jan 16:13:01 - [nodemon] to restart at any time, enter `rs`
21 Jan 16:13:01 - [nodemon] watching: *.*
21 Jan 16:13:01 - [nodemon] starting `C:\Users\Public\with spaces\node.exe -c console.log(1)`
'C:\Users\Public\with' is not recognized as an internal or external command, operable program or batch file.
how about some double-quotes?
>node bin\nodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\"" -- -c console.log(1)
21 Jan 16:14:22 - [nodemon] v1.3.2
21 Jan 16:14:22 - [nodemon] to restart at any time, enter `rs`
21 Jan 16:14:22 - [nodemon] watching: *.*
21 Jan 16:14:22 - [nodemon] starting `"C:\Users\Public\with spaces\node.exe" -c console.log(1)`
'\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command, operable program or batch file.
double-double-quotes?
>node bin\nodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\"\"" -- -c console.log(1)
21 Jan 16:15:06 - [nodemon] v1.3.2
21 Jan 16:15:06 - [nodemon] to restart at any time, enter `rs`
21 Jan 16:15:06 - [nodemon] watching: *.*
21 Jan 16:15:06 - [nodemon] starting `""C:\Users\Public\with spaces\node.exe"" -c console.log(1)`
The network name cannot be found.
well that's a different error, but that's probably not a good thing?
maybe I'll pass it as one big --exec option?
>node bin\nodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)"
21 Jan 16:17:19 - [nodemon] v1.3.2
21 Jan 16:17:19 - [nodemon] to restart at any time, enter `rs`
21 Jan 16:17:19 - [nodemon] watching: *.*
21 Jan 16:17:19 - [nodemon] starting `"C:\Users\Public\with spaces\node.exe" -c console.log(1)`
'\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command,
operable program or batch file.
Maybe cmd wants me to wrap the whole thing in another set of double quotes?
>node bin\nodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)\""
21 Jan 16:18:03 - [nodemon] v1.3.2
21 Jan 16:18:03 - [nodemon] to restart at any time, enter `rs`
21 Jan 16:18:03 - [nodemon] watching: *.*
21 Jan 16:18:03 - [nodemon] starting `""C:\Users\Public\with spaces\node.exe" -c console.log(1)"`
The network name cannot be found.
You're probably sick of me filing bugs on special characters. Feel free to close it if you don't want to reproduce / fix, I'm just filing it to make sure the issue is known.
I no longer mind if you fix this bug or not (and I probably won't try to reproduce on later versions), at this point I'm just going to use a minimal fork which doesn't pass anything through sh or cmd. I mean no disrespect by forking - I thank you for all your hard work on nodemon, but for my use case it's just not worth diagnosing and working around these endless escaping issues.
Did you try the carat symbol. A quick google search found that in windows
you don't use quotes to wrap space paths, but you escape the space with a
carat.
On 22 Jan 2015 01:36, "Tim Cuthbertson" [email protected] wrote:
I rarely deal with windows, so maybe I'm missing something. But I feel
like I've tried most things that could reasonably be expected to work. This
is all on the just-released v1.3.2.I have an executable in C:\Users\Public\with spaces\node.exe, and I would
like nodemon to run it. This is what happened:This would be nice, but I don't expect it to work:
node nodemon\binnodemon.js --exec "C:\Users\Public\with spaces\node.exe" -- -c console.log(1)
21 Jan 16:13:01 - [nodemon] v1.3.2
21 Jan 16:13:01 - [nodemon] to restart at any time, enterrs
21 Jan 16:13:01 - [nodemon] watching: _._
21 Jan 16:13:01 - [nodemon] startingC:\Users\Public\with spaces\node.exe -c console.log(1)
'C:\Users\Public\with' is not recognized as an internal or external command, operable program or batch file.how about some double-quotes?
node binnodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\"" -- -c console.log(1)
21 Jan 16:14:22 - [nodemon] v1.3.2
21 Jan 16:14:22 - [nodemon] to restart at any time, enterrs
21 Jan 16:14:22 - [nodemon] watching: _._
21 Jan 16:14:22 - [nodemon] starting"C:\Users\Public\with spaces\node.exe" -c console.log(1)
'\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command, operable program or batch file.double-double-quotes?
node binnodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\"\"" -- -c console.log(1)
21 Jan 16:15:06 - [nodemon] v1.3.2
21 Jan 16:15:06 - [nodemon] to restart at any time, enterrs
21 Jan 16:15:06 - [nodemon] watching: _._
21 Jan 16:15:06 - [nodemon] starting""C:\Users\Public\with spaces\node.exe"" -c console.log(1)
The network name cannot be found.well that's a different error, but that's probably not a good thing?
maybe I'll pass it as one big --exec option?
node binnodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)"
21 Jan 16:17:19 - [nodemon] v1.3.2
21 Jan 16:17:19 - [nodemon] to restart at any time, enterrs
21 Jan 16:17:19 - [nodemon] watching: _._
21 Jan 16:17:19 - [nodemon] starting"C:\Users\Public\with spaces\node.exe" -c console.log(1)
'\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command,
operable program or batch file.Maybe cmd wants me to wrap the whole thing in another set of double quotes?
node binnodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)\""
21 Jan 16:18:03 - [nodemon] v1.3.2
21 Jan 16:18:03 - [nodemon] to restart at any time, enterrs
21 Jan 16:18:03 - [nodemon] watching: _._
21 Jan 16:18:03 - [nodemon] starting""C:\Users\Public\with spaces\node.exe" -c console.log(1)"
The network name cannot be found.You're probably sick of me filing bugs on special characters. Feel free to
close it if you don't want to reproduce / fix, I'm just filing it to make
sure the issue is known.I no longer mind if you fix this bug or not (and I probably won't try to
reproduce on later versions), at this point I'm just going to use a minimal
fork which doesn't pass anything through sh or cmd. I mean no disrespect
by forking - I thank you for all your hard work on nodemon, but for my
use case it's just not worth diagnosing and working around these endless
escaping issues.—
Reply to this email directly or view it on GitHub
https://github.com/remy/nodemon/issues/474.
That's news to me (weird that cmd /? doesn't say anything about it).
I gave it a go, and the results are underwhelming:
C:>node bin\nodemon.js --exec "C:\Users\Public\with^ spaces\node.exe" -- -e console.log(1)
22 Jan 14:02:44 - [nodemon] v1.3.2
22 Jan 14:02:44 - [nodemon] to restart at any time, enter `rs`
22 Jan 14:02:44 - [nodemon] watching: *.*
22 Jan 14:02:44 - [nodemon] starting `C:\Users\Public\with^ spaces\node.exe -e console.log(1)`
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Public\with spaces\spaces\node.exe'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
22 Jan 14:02:44 - [nodemon] app crashed - waiting for file changes before starting...
It _seems_ to be starting node, and then something's going wildly wrong given the module path it seems to be trying to load. It's hard to tell whether this is a node or cmd bug (my money is on cmd, or just "windows" ;)). Regardless of whose bug it is, it's definitely triggered by the cmd indirection:
C:>"C:\Users\Public\with spaces\node.exe" -e console.log(1)
1
C:>cmd /c "C:\Users\Public\with^ spaces\node.exe" -e console.log(1)
module.js:340
throw err;
^
Error: Cannot find module 'C:\Users\Public\with spaces\spaces\node.exe'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Have you actually tried to run nodemon (on windows) with an executable path with spaces in it? I really think this deserves to be part of some integration test cases (not just unit tests), given how problematic it seems to be...
Having the exact same issue having just downloaded the latest 1.9.0 Is this really fixed?
Error: Cannot find module 'C:\Marc\Google Drive\Worknode\"C:\Marc\Google'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
This is an issue with Chokidar which I've not had time to send a PR to fix. It thinks the directory with a space is a regexp...
@remy I'm having the same issue. -v 1.10.2
Having this issue trying to run nodemon through PHPStorm's debugger.
"C:\Program Files (x86)\JetBrains\PhpStorm 2016.2\bin\runnerw.exe" "C:\Program Filesnodejsnode.exe" --debug-brk=64538 --expose-debug-as=v8debug C:\Users\scott\AppData\Roaming\npmnode_modulesnodemon\binnodemon.js "C:\Projects\Project With Spaces\index.js"
Debugger listening on [::]:64538
[nodemon] 1.10.2
[nodemon] to restart at any time, enter rs
[nodemon] watching: _._
[nodemon] starting node "C:\\Projects\\Project With Spaces\\index.js"
module.js:442
throw err;
^
Error: Cannot find module 'c:\Projects\Project With Spaces\"C:\Projects\Project'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
[nodemon] app crashed - waiting for file changes before starting...
@timbertson
Sir,I found a method to solve blank in Windows.
1) Use the abbreviation. For example, c:\Program Files is abbreviated as c:\Progra~1
Then ask the root to ask if there is a rule for this naming, so find:
Use 8 character abbreviations, that is, write the first six letters (omit blank), add tilde and 1, the first letter is less than six letters, omit the blank, use the letter of the second word, make up six. E.g:
"Documents and Settings" -- DOCUME~1
"Local Settings" -- LOCALS~1 (note the blank, use the letters of the second word, make up six, plus the tilde and 1).
What if the first 6 characters of multiple files are the same? Why is the last 1 instead of 0 or other numbers? Look at this example
Suppose the following is the folder in the root directory of your C drive:
Program Files
Progra file
Progra zhang
The three directories are respectively represented as:
C:\Progra~1
C:\Progra~2
C:\Progra~3
2) Go around and create a mirror. For example, type subst w: "C:\Documents and Settings\hopeshared"in cmd. Then you can use w:\ instead of C:\Documents and Settings\hopeshared
I rarely deal with windows, so maybe I'm missing something. But I feel like I've tried most things that could reasonably be expected to work. This is all on the just-released v1.3.2.
I have an executable in
C:\Users\Public\with spaces\node.exe, and I would like nodemon to run it. This is what happened:This would be nice, but I don't expect it to work:
> node nodemon\bin\nodemon.js --exec "C:\Users\Public\with spaces\node.exe" -- -c console.log(1) 21 Jan 16:13:01 - [nodemon] v1.3.2 21 Jan 16:13:01 - [nodemon] to restart at any time, enter `rs` 21 Jan 16:13:01 - [nodemon] watching: *.* 21 Jan 16:13:01 - [nodemon] starting `C:\Users\Public\with spaces\node.exe -c console.log(1)` 'C:\Users\Public\with' is not recognized as an internal or external command, operable program or batch file.how about some double-quotes?
>node bin\nodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\"" -- -c console.log(1) 21 Jan 16:14:22 - [nodemon] v1.3.2 21 Jan 16:14:22 - [nodemon] to restart at any time, enter `rs` 21 Jan 16:14:22 - [nodemon] watching: *.* 21 Jan 16:14:22 - [nodemon] starting `"C:\Users\Public\with spaces\node.exe" -c console.log(1)` '\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command, operable program or batch file.double-double-quotes?
>node bin\nodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\"\"" -- -c console.log(1) 21 Jan 16:15:06 - [nodemon] v1.3.2 21 Jan 16:15:06 - [nodemon] to restart at any time, enter `rs` 21 Jan 16:15:06 - [nodemon] watching: *.* 21 Jan 16:15:06 - [nodemon] starting `""C:\Users\Public\with spaces\node.exe"" -c console.log(1)` The network name cannot be found.well that's a different error, but that's probably not a good thing?
maybe I'll pass it as one big --exec option?
>node bin\nodemon.js --exec "\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)" 21 Jan 16:17:19 - [nodemon] v1.3.2 21 Jan 16:17:19 - [nodemon] to restart at any time, enter `rs` 21 Jan 16:17:19 - [nodemon] watching: *.* 21 Jan 16:17:19 - [nodemon] starting `"C:\Users\Public\with spaces\node.exe" -c console.log(1)` '\"C:\Users\Public\with spaces\node.exe\"' is not recognized as an internal or external command, operable program or batch file.Maybe cmd wants me to wrap the whole thing in another set of double quotes?
>node bin\nodemon.js --exec "\"\"C:\Users\Public\with spaces\node.exe\" -c console.log(1)\"" 21 Jan 16:18:03 - [nodemon] v1.3.2 21 Jan 16:18:03 - [nodemon] to restart at any time, enter `rs` 21 Jan 16:18:03 - [nodemon] watching: *.* 21 Jan 16:18:03 - [nodemon] starting `""C:\Users\Public\with spaces\node.exe" -c console.log(1)"` The network name cannot be found.You're probably sick of me filing bugs on special characters. Feel free to close it if you don't want to reproduce / fix, I'm just filing it to make sure the issue is known.
I no longer mind if you fix this bug or not (and I probably won't try to reproduce on later versions), at this point I'm just going to use a minimal fork which doesn't pass anything through
shorcmd. I mean no disrespect by forking - I thank you for all your hard work onnodemon, but for my use case it's just not worth diagnosing and working around these endless escaping issues.
Most helpful comment
Did you try the carat symbol. A quick google search found that in windows
you don't use quotes to wrap space paths, but you escape the space with a
carat.
On 22 Jan 2015 01:36, "Tim Cuthbertson" [email protected] wrote: