I just ended the tutorial of Angular 2 and I can't find a way to change the localhost port from 3000 to 8000. In my package.json
file there's the line "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
that I believe is related but I'm not sure.
In ReactJS, the easiest way to alter the port number is by setting an environment variable named PORT to the desired number via the terminal. As an example, here we change the port number to 5000. your local server will run on port 5000.
You can stop process with ctrl+C in the terminal window.
json , you can change the port inside the lite-server module. Go to node_modules/lite-server/lib/config-defaults. js in your project, then add the port in "modules. export" like this.
You can change it inside bs-config.json
file as mentioned in the docs https://github.com/johnpapa/lite-server#custom-configuration
For example,
{ "port": 8000, "files": ["./src/**/*.{html,htm,css,js}"], "server": { "baseDir": "./src" } }
Using Angular 4 and the cli that came with it I was able to start the server with $npm start -- --port 8000
. That worked ok: ** NG Live Development Server is listening on localhost:8000, open your browser on http://localhost:8000 **
Got the tip from Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With