Skip to content

Doesn't work with Windows #5

@cpu999

Description

@cpu999

I tried to use this in Windows but it fails. I traced the issue to the use of single quotes. Windows doesn't recognize 'just one parm' as a single parameter, but as 3 parameters which with bash/unix would have been typed 'just one parm'. In the example of running "npm run watch" I got an error telling me that 'npm isn't an executable (notice the leading quote). I added some logging and I got this:

C:\usr\local\angular\projects\npm-scripts-example-master>parallelshell 'where npm'
[ 'node',
  'C:\\usr\\local\\angular\\projects\\npm-scripts-example-master\\node_modules\\parallelshell\\index.js',
  '\'where',
  'npm\'' ]

C:\usr\local\angular\projects\npm-scripts-example-master>parallelshell "where npm"
[ 'node',
  'C:\\usr\\local\\angular\\projects\\npm-scripts-example-master\\node_modules\\parallelshell\\index.js',
  'where npm' ]

As you can see, single quotes and double quotes aren't considered the same in windoze. :-( (You can thank Billy for that.)

So, I was able to get a bit further along by doing something like this:

"watch": "parallelshell \"npm run watch:test -s\" \"npm run watch:build -s\"",

I also noticed that this was frowned upon by npm:

"watch": 'parallelshell "npm run watch:test -s" "npm run watch:build -s"',

It wants the "watch" parameter to start with a double quote and gives this error:
npm ERR! Failed to parse json
npm ERR! Unexpected token '

I also tried with Cygwin and bash provided in Git, without success, and this problem is not just limited to 'parallelshell' but even this fails:

"build": "npm run build:scripts -s && npm run build:styles -s && npm run build:markup -s",

So, in the end even if this seems like a good idea, it didn't work but it would be nice if it did.

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