Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm start does not open browser tab

I am learning angularjs 2.I want to make my first application in angularjs 2 from their official website.So i followed all from here https://angular.io/guide/quickstart. Now in step 6 I have to run a command 'npm start' in terminal.It gives me result in terminal like--

$ npm start

> [email protected] start D:\Sadiq\Res\Angularjs__2\angularQ
> tsc && concurrently "tsc -w" "lite-server"

[1] Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
[1] ** browser-sync config **
[1] { injectChanges: false,
[1]   files: [ './**/*.{html,htm,css,js}' ],
[1]   watchOptions: { ignored: 'node_modules' },
[1]   server: { baseDir: './', middleware: [ [Function], [Function] ] } }
[1] [BS] Access URLs:
[1]  -------------------------------------
[1]        Local: http://localhost:3002
[1]     External: http://192.168.2.93:3002
[1]  -------------------------------------
[1]           UI: http://localhost:3003
[1]  UI External: http://192.168.2.93:3003
[1]  -------------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] [BS] File changed: app\app.component.js
[1] [BS] File changed: app\app.module.js
[1] [BS] File changed: app\main.js
[0] 12:01:51 PM - Compilation complete. Watching for file changes.

But it does not open any tab in my crome.If i enter the url it provided

'http://localhost:3002'

manually in the address bar it gives the result as expected,works fine and any changes in source file immediately cause change in the browser. problem is: I can not figure out why it is not open tab in browser automatically. Can anyone help me?

UPDATE 07 NOV 2016

Important observation is that I copied my project in another two pc. There it works as expected.when i run 'npm start' it opens tab in browser and runs the application.So there it creates no problem and works according to official angular2 tutorial site.can anyone have any idea why this is happening in my pc or my browser?

like image 975
Mohammad Sadiqur Rahman Avatar asked Nov 06 '16 06:11

Mohammad Sadiqur Rahman


1 Answers

Everything looks fine, only reason might be if you there is open:false in your config. Can you try this,

create a file bs-config.js at root & add this code,

module.exports = {
  port: 5000,//custom port
  files: ['./**/*.{html,htm,css,js}'],
  open: true
};
like image 102
manish.nith Avatar answered Nov 15 '22 21:11

manish.nith