Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not reading command properly when used with npm? #50

Closed
georgeedwards opened this issue Aug 7, 2016 · 9 comments
Closed

not reading command properly when used with npm? #50

georgeedwards opened this issue Aug 7, 2016 · 9 comments

Comments

@georgeedwards
Copy link

You can see my issue from the log below. When run with npm, my concurrently script seems to be misinterpreting the commands. Both commands work fine manually. I am running on Windows 10. or have I just misinterpreted the docs?

npm run dev

> docs@0.0.0 dev C:\Users\George\Source\Repos\docs
> concurrently --kill-others 'tsc --watch' 'nodemon ./bin/www'

[0] 'ts' is not recognized as an internal or external command,
[0] operable program or batch file.
[1] '"./bin/www'"' is not recognized as an internal or external command,
[1] operable program or batch file.
[1] ./bin/www' exited with code 1
[0] ts exited with code 1
@georgeedwards
Copy link
Author

Having installed globally and run directly in cmd, I get the same result, so it isn't an npm thing.

@kimmobrunfeldt
Copy link
Contributor

Concurrently is using cross-spawn library to run the commands, apparently it doesn't know how to run ts or ./bin/www: https://github.com/kimmobrunfeldt/concurrently/blob/master/src/main.js#L10

The command running has been an issue all the time. I'm happy to accept a PR which would use a better library than cross-spawn.

btw, I'm currently on my vacation so I don't have time to maintain this repository that much.

@georgeedwards
Copy link
Author

@kimmobrunfeldt The issue I don't understand is that ts isn't the command, it's tsc --watch why isn't it interpreting the inputs correctly?

@benbroadley88
Copy link

I've been having this same issue today and it seems to be an issue with single vs. double quotes. When run on the command line concurrently 'npm run min-js' seems to be parsed as np run min-js which for obvious reasons wouldn't run correctly. However the command was parsed correctly when double quotes were used, so: concurrently "npm run min-js" runs fine.

For me, the problem with running this via npm was that the script itself is wrapped in double quotes when written in the package.json file (and therefore I had exchanged the inner quotes for single quotes which were causing the parsing bug to be encountered) - A simple work around was to revert back to double quotes but escape them with \ and this now appears to work as expected. e.g:

"scripts": { "build": "concurrently --kill-others \"npm run scriptTwo\" \"npm run scriptOne\"" }

@kimmobrunfeldt
Copy link
Contributor

I missed this bug when reading the issue for the first time. If commands are only partially parsed, that's a very bad bug. Could you test this with 3.0.0-dev version with npm i concurrently@3.0.0-dev

@kimmobrunfeldt
Copy link
Contributor

These issues should be now fixed in 3.0.0-rc1. npm i -g concurrently@3.0.0-rc1. Please open a new issue to concurrently repo if this is not the case. I'll release the 3.0.0 soonish.

@jens-duttke
Copy link

I'm using version 3.6.0 and have the exactly same problem.

@swjain
Copy link

swjain commented Oct 28, 2018

Issue still exists on 3.6.1

@gustavohenke
Copy link
Member

@swjain @jens-duttke can you guys please try v4, and open a new issue with more details?
I'm afraid that that problem happens because Windows doesn't support single quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants