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

CLI doesn't work with single quotes on windows #109

Closed
ismay opened this issue Jun 24, 2016 · 3 comments
Closed

CLI doesn't work with single quotes on windows #109

ismay opened this issue Jun 24, 2016 · 3 comments

Comments

@ismay
Copy link

ismay commented Jun 24, 2016

When using the CLI from package.json this fails:

// ...
  "scripts": {
    "watch": "watch 'npm run start' src"
  },
// ...

With the following error:

> "watch 'npm run start' src
> Watching 'npm
> Watching run
> Watching start'
C:\Projects\simple\node_modules\watch\main.js:73
    if (err) throw err;
             ^

Error: ENOENT: no such file or directory, stat 'C:\Projects\simple\'npm'
    at Error (native)

But this does:

// ...
  "scripts": {
    "watch": "watch \"npm run start\" src"
  },
// ...

Being used to *nix this was a bit of a surprise. Don't know if this is expected behaviour on windows, or a bug, but just thought I'd report it.

@levithomason
Copy link
Collaborator

levithomason commented Jun 24, 2016

This is indeed a windows limitation. Your escaped double quote solution is the correct approach.

EDIT

To clarify, I mean to say it is entirely unrelated to watch. On Windows when using quotes in scripts you need to use double quotes due to how Windows handles them on the command line.

@ismay
Copy link
Author

ismay commented Jun 24, 2016

Ok cool, thanks!

@levithomason
Copy link
Collaborator

No problem, thanks for the report.

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

2 participants