npm run browser-sync on windows doesn't work
See original GitHub issueI have a project where I’m configuring my build steps through package.json
scripts.
The following line for browser-sync:
"server": "browser-sync start --port 3000 --files 'dist/**/*' --server 'dist' --directory"
It works fine on OSX for me, but if my buddy runs npm run server
on Windows 10 and opens localhost:3000, he just sees the Express Cannot GET /
.
However, if he runs ./node_modules/.bin/browser-sync start --port 3000 --files 'dist/**/*' --server 'dist' --directory
directly (not through npm) and opens localhost:3000 he gets a directory listing of the dist
directory as expected.
node v5.3.0, npm v.3.3.12, browser-sync v2.10.1 and using git bash (cygwin didn’t make a difference).
What could be causing this issue and how do we get around it?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
browser-sync on Windows 11 - npm
I'm starting browser-sync by running browser-sync start -c .\bs-config.js in PowerShell. On Windows10 it works fine but Win11 has some new ...
Read more >Browsersync on Windows 10 workaround | by Gichu Wil
I found a work around on using Browsersync on Windows 10. I think the reason its not working is because the files are...
Read more >Browsersync Documentation
Windows users ^ TOP ... Having trouble installing Browsersync on Windows? The most common reason for npm to throw errors when compiling Browsersync...
Read more >browser-sync
Start using browser-sync in your project by running `npm i browser-sync`. ... Browsersync works by injecting an asynchronous script tag ...
Read more >NPM browser-sync Package (Install, Use, and Examples)
Open the terminal window and navigate to the location where you want to create your project. I'm creating the directory es6-tutorials in the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, this does not work on windows.
but this does.
Notice how I have to escape all of the
'
with\"
.Anyone figure this out. I’m having the same issue. Works fine on mac. Works fine when not using ‘npm run’.