question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with Windows

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

29reactions
christianseelcommented, Jan 15, 2015

Hey, from my latest experience it works just fine if you replace all ' (single quote) with \" (escaped double quote)…

1reaction
cpu999commented, Jan 15, 2015

Christian,

I hope this will help as I am not trying to complain.

I installed your example from the downloaded ZIP. Then I ran “npm install” to get all the dependencies. The “npm run watch” still fails but some commands work, like the “npm run build”. I tried this on 2 machines as the corporate computer is sometimes tempermental but my personal computer isn’t. I got the same results.

Here is some of the run samples: (I highlighted the command lines but the email program highlighted what looks like email addresses)

C:\usr\local\angular\projects\npm-scripts-example-master>npm run watch

npm-scripts-example@1.0.0 watch C:\usr\local\angular\projects\npm-scripts-example-master parallelshell “npm run watch:test -s” “npm run watch:build -s”

npm run watch:build -s failed with exit code 1

npm ERR! npm-scripts-example@1.0.0 watch: parallelshell "npm run watch:test -s" "npm run watch:build -s" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the npm-scripts-example@1.0.0 watch script. npm ERR! This is most likely a problem with the npm-scripts-example package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! parallelshell “npm run watch:test -s” “npm run watch:build -s” npm ERR! You can get their info via: npm ERR! npm owner ls npm-scripts-example npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command “C:\usr\local\nodejs\node.exe” “C:\usr\local\nodejs\node_modules\npm\bin\npm-cli.js” “run” “watch” npm ERR! cwd C:\usr\local\angular\projects\npm-scripts-example-master npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR!
C:\usr\local\angular\projects\npm-scripts-example-master\npm-debug.log npm ERR! not ok code 0

C:\usr\local\angular\projects\npm-scripts-example-master>npm run watch:build

npm-scripts-example@1.0.0 watch:build C:\usr\local\angular\projects\npm-scripts-example-master nodemon -q -w assets/ --ext “.” --exec “npm run build”

npm ERR! npm-scripts-example@1.0.0 watch:build: nodemon -q -w assets/ --ext "." --exec "npm run build" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the npm-scripts-example@1.0.0 watch:build script. npm ERR! This is most likely a problem with the npm-scripts-example package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! nodemon -q -w assets/ --ext “.” --exec “npm run build” npm ERR! You can get their info via: npm ERR! npm owner ls npm-scripts-example npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command “C:\usr\local\nodejs\node.exe” “C:\usr\local\nodejs\node_modules\npm\bin\npm-cli.js” “run” “watch:build” npm ERR! cwd C:\usr\local\angular\projects\npm-scripts-example-master npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR!
C:\usr\local\angular\projects\npm-scripts-example-master\npm-debug.log npm ERR! not ok code 0

C:\usr\local\angular\projects\npm-scripts-example-master>npm run build

npm-scripts-example@1.0.0 prebuild C:\usr\local\angular\projects\npm-scripts-example-master npm run clean -s

npm-scripts-example@1.0.0 build C:\usr\local\angular\projects\npm-scripts-example-master npm run build:scripts -s && npm run build:styles -s && npm run build:markup -s

generated dist\main.css.map compiled dist\main.css

rendered dist\index.html

C:\usr\local\angular\projects\npm-scripts-example-master> Although I would very much like to be able to use npm to configure the builds, it seems that there still is some reason why other build tools were developed.

Thanks.

Gerard Perreault

------ Original Message ------ From: “Christian Seel” notifications@github.com To: “keithamus/npm-scripts-example” npm-scripts-example@noreply.github.com Cc: “cpu999” gperreault_sub@verizon.net Sent: 1/15/2015 1:23:40 PM Subject: Re: [npm-scripts-example] Doesn’t work with Windows (#5)

Hey, from my latest experience it works just fine if you replace all ’ (single quote) with " (escaped double quote)…

— Reply to this email directly or view it on GitHub.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Camera doesn't work in Windows - Microsoft Support
Select Start , type device manager, then select it from the search results. · Find the problem webcam from the list of devices...
Read more >
What You Should Do If Windows Fails to Start
The quickest way to get to Startup Repair is to hard-power-down your PC while it's booting three times. You normally do this by...
Read more >
17 most common Windows 10 problems and how to fix them
17 most common Windows 10 problems and how to fix them · 1. Can't upgrade from Windows 7 or Windows 8 · 2....
Read more >
[SOLVED] Windows 10 Start Menu Not Working: 13 Methods
Ways To Fix Windows 10 Start Menu Not Working Error · Method 1: Update Windows · Method 2: Update drivers · Method 3:...
Read more >
Audio Not Working in Windows 10? 9 Ways to Fix Sound ...
Audio Not Working in Windows 10? 9 Ways to Fix Sound Problems · 1. Check Volume Levels and Muted Outputs · 2. Make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found