replace
replace copied to clipboard
`replace` a keyword in windows cmd.exe
Hi! Lovely util. Without all the drama I would've never come across it.
Now, I tried using it on Windows, and got really weird behaviour, until I realized that there's actually a cmd.exe command called "replace". I solved it by copying .../npm/replace.cmd
to .../npm/replacejs.cmd
. Maybe it would be good to include that alias by default? Or, if npm allows, by default on Windows systems?
Ooh, that's not good. Thanks for reporting this. I'll look into it.
replace is also a keyword used by maria-db
But can you run npm scripts from mariadb? i mean, maybe I'm missing something, but how is that a problem?
What i meant was maria-db also has a command line prompt named replace. So it clashes with this replace
I was just about to make your package a dependency on our project, as it looks like it'll be the perfect fit, but then I tried typing "replace" on my command line and found that I, too, have such an executable in my path already (it comes with MAMP for OS X). I wonder if you'd best rename your utility to something a little less likely to cause name clashes? "replace" is certainly a common word.
I have had this problem too. There are several ways to get around it.
- make an alias in your shell to whatever you want
- directly execute the node_module
./node_modules/.bin/replace
- fork it, change the executable name
npm install username/replace --save
I'm sure there are plenty more.
I'm not using it globally, but the command works perfectly in Windows cmd.exe so long as it's either called as node_modules\.bin\replace
or from a script in package.json. One Windows-specific note which might trip up the unix-fluent (me): Arguments must be enclosed in double-quotes. Single-quotes do something different in the default Window CLI.
C:\Users\joe\Desktop\replacer> node_modules\.bin\replace "foo" "bar" foobar.txt
👍