Unrecognized PORT command












0














I am trying to run nodeJs on my localhost. Command used,



PORT=4080 node server.js


But, it was throwing an unexpected error.




'PORT' is not recognized as an internal or external command, operable
program or batch file.




Do I need to install any module or did I miss any syntax to run it properly?










share|improve this question
























  • The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
    – Subburaj
    Dec 14 '17 at 5:52










  • I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
    – kvk30
    Dec 14 '17 at 5:56












  • You said you have configured for port 3000, you an change that configuration to 4080, it should work??
    – Subburaj
    Dec 14 '17 at 5:59










  • @Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
    – kvk30
    Dec 14 '17 at 6:01
















0














I am trying to run nodeJs on my localhost. Command used,



PORT=4080 node server.js


But, it was throwing an unexpected error.




'PORT' is not recognized as an internal or external command, operable
program or batch file.




Do I need to install any module or did I miss any syntax to run it properly?










share|improve this question
























  • The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
    – Subburaj
    Dec 14 '17 at 5:52










  • I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
    – kvk30
    Dec 14 '17 at 5:56












  • You said you have configured for port 3000, you an change that configuration to 4080, it should work??
    – Subburaj
    Dec 14 '17 at 5:59










  • @Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
    – kvk30
    Dec 14 '17 at 6:01














0












0








0







I am trying to run nodeJs on my localhost. Command used,



PORT=4080 node server.js


But, it was throwing an unexpected error.




'PORT' is not recognized as an internal or external command, operable
program or batch file.




Do I need to install any module or did I miss any syntax to run it properly?










share|improve this question















I am trying to run nodeJs on my localhost. Command used,



PORT=4080 node server.js


But, it was throwing an unexpected error.




'PORT' is not recognized as an internal or external command, operable
program or batch file.




Do I need to install any module or did I miss any syntax to run it properly?







node.js windows command-prompt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 27 '18 at 16:34

























asked Dec 14 '17 at 5:47









kvk30

492523




492523












  • The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
    – Subburaj
    Dec 14 '17 at 5:52










  • I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
    – kvk30
    Dec 14 '17 at 5:56












  • You said you have configured for port 3000, you an change that configuration to 4080, it should work??
    – Subburaj
    Dec 14 '17 at 5:59










  • @Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
    – kvk30
    Dec 14 '17 at 6:01


















  • The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
    – Subburaj
    Dec 14 '17 at 5:52










  • I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
    – kvk30
    Dec 14 '17 at 5:56












  • You said you have configured for port 3000, you an change that configuration to 4080, it should work??
    – Subburaj
    Dec 14 '17 at 5:59










  • @Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
    – kvk30
    Dec 14 '17 at 6:01
















The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
– Subburaj
Dec 14 '17 at 5:52




The above command is Unix (Ubuntu, Mac, etc…). In windows enviroment, you need a different syntax. Google something like "set env in windows command line"
– Subburaj
Dec 14 '17 at 5:52












I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
– kvk30
Dec 14 '17 at 5:56






I configured environment variable for nodeJs, If I run node server.js, It was running on port 3000. But I need to run it on port 4030. I thought, I need a module for the port but I didn't find anything related to that in google. I thought it would be useful for others if I raise this as an issue.
– kvk30
Dec 14 '17 at 5:56














You said you have configured for port 3000, you an change that configuration to 4080, it should work??
– Subburaj
Dec 14 '17 at 5:59




You said you have configured for port 3000, you an change that configuration to 4080, it should work??
– Subburaj
Dec 14 '17 at 5:59












@Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
– kvk30
Dec 14 '17 at 6:01




@Subburaj, It is a default port but I need to change it to 4080. For that configuration, I didn't find any article.
– kvk30
Dec 14 '17 at 6:01












3 Answers
3






active

oldest

votes


















4














Another interesting thing the worked for me without using cross-env.



SET PORT=4080&& node server.js 


PS: Set enviroment varible for nodeJs, run command in project folder.






share|improve this answer





















  • This would cause your system variables to change, which is not very desirable. cross-env solves this.
    – Faizuddin Mohammed
    Dec 14 '17 at 10:12



















2















  • Install this additional package cross-env in your node
    environment. The above command you mentioned is Unix (Ubuntu, Mac,
    etc…). In the windows environment, you need a different syntax and cross-env does your job.

  • You can also create an .env file with





PORT=3006





and save it in your
project directory.






share|improve this answer





















  • Hey please check my answer and verify it :)
    – kvk30
    Dec 14 '17 at 6:22



















1














SET PORT=8090 && nodemon server.js that worked for me






share|improve this answer





















  • I need to run port 4080
    – kvk30
    Oct 1 '18 at 7:06










  • Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
    – sɐunıɔןɐqɐp
    Oct 1 '18 at 7:23










  • If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
    – Mbanda
    Oct 1 '18 at 13:13












  • @Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
    – kvk30
    Dec 27 '18 at 16:37











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47806623%2funrecognized-port-command%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














Another interesting thing the worked for me without using cross-env.



SET PORT=4080&& node server.js 


PS: Set enviroment varible for nodeJs, run command in project folder.






share|improve this answer





















  • This would cause your system variables to change, which is not very desirable. cross-env solves this.
    – Faizuddin Mohammed
    Dec 14 '17 at 10:12
















4














Another interesting thing the worked for me without using cross-env.



SET PORT=4080&& node server.js 


PS: Set enviroment varible for nodeJs, run command in project folder.






share|improve this answer





















  • This would cause your system variables to change, which is not very desirable. cross-env solves this.
    – Faizuddin Mohammed
    Dec 14 '17 at 10:12














4












4








4






Another interesting thing the worked for me without using cross-env.



SET PORT=4080&& node server.js 


PS: Set enviroment varible for nodeJs, run command in project folder.






share|improve this answer












Another interesting thing the worked for me without using cross-env.



SET PORT=4080&& node server.js 


PS: Set enviroment varible for nodeJs, run command in project folder.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 14 '17 at 6:18









kvk30

492523




492523












  • This would cause your system variables to change, which is not very desirable. cross-env solves this.
    – Faizuddin Mohammed
    Dec 14 '17 at 10:12


















  • This would cause your system variables to change, which is not very desirable. cross-env solves this.
    – Faizuddin Mohammed
    Dec 14 '17 at 10:12
















This would cause your system variables to change, which is not very desirable. cross-env solves this.
– Faizuddin Mohammed
Dec 14 '17 at 10:12




This would cause your system variables to change, which is not very desirable. cross-env solves this.
– Faizuddin Mohammed
Dec 14 '17 at 10:12













2















  • Install this additional package cross-env in your node
    environment. The above command you mentioned is Unix (Ubuntu, Mac,
    etc…). In the windows environment, you need a different syntax and cross-env does your job.

  • You can also create an .env file with





PORT=3006





and save it in your
project directory.






share|improve this answer





















  • Hey please check my answer and verify it :)
    – kvk30
    Dec 14 '17 at 6:22
















2















  • Install this additional package cross-env in your node
    environment. The above command you mentioned is Unix (Ubuntu, Mac,
    etc…). In the windows environment, you need a different syntax and cross-env does your job.

  • You can also create an .env file with





PORT=3006





and save it in your
project directory.






share|improve this answer





















  • Hey please check my answer and verify it :)
    – kvk30
    Dec 14 '17 at 6:22














2












2








2







  • Install this additional package cross-env in your node
    environment. The above command you mentioned is Unix (Ubuntu, Mac,
    etc…). In the windows environment, you need a different syntax and cross-env does your job.

  • You can also create an .env file with





PORT=3006





and save it in your
project directory.






share|improve this answer













  • Install this additional package cross-env in your node
    environment. The above command you mentioned is Unix (Ubuntu, Mac,
    etc…). In the windows environment, you need a different syntax and cross-env does your job.

  • You can also create an .env file with





PORT=3006





and save it in your
project directory.






PORT=3006





PORT=3006






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 14 '17 at 6:03









go_gunner

213




213












  • Hey please check my answer and verify it :)
    – kvk30
    Dec 14 '17 at 6:22


















  • Hey please check my answer and verify it :)
    – kvk30
    Dec 14 '17 at 6:22
















Hey please check my answer and verify it :)
– kvk30
Dec 14 '17 at 6:22




Hey please check my answer and verify it :)
– kvk30
Dec 14 '17 at 6:22











1














SET PORT=8090 && nodemon server.js that worked for me






share|improve this answer





















  • I need to run port 4080
    – kvk30
    Oct 1 '18 at 7:06










  • Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
    – sɐunıɔןɐqɐp
    Oct 1 '18 at 7:23










  • If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
    – Mbanda
    Oct 1 '18 at 13:13












  • @Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
    – kvk30
    Dec 27 '18 at 16:37
















1














SET PORT=8090 && nodemon server.js that worked for me






share|improve this answer





















  • I need to run port 4080
    – kvk30
    Oct 1 '18 at 7:06










  • Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
    – sɐunıɔןɐqɐp
    Oct 1 '18 at 7:23










  • If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
    – Mbanda
    Oct 1 '18 at 13:13












  • @Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
    – kvk30
    Dec 27 '18 at 16:37














1












1








1






SET PORT=8090 && nodemon server.js that worked for me






share|improve this answer












SET PORT=8090 && nodemon server.js that worked for me







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 1 '18 at 7:04









Mbanda

494




494












  • I need to run port 4080
    – kvk30
    Oct 1 '18 at 7:06










  • Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
    – sɐunıɔןɐqɐp
    Oct 1 '18 at 7:23










  • If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
    – Mbanda
    Oct 1 '18 at 13:13












  • @Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
    – kvk30
    Dec 27 '18 at 16:37


















  • I need to run port 4080
    – kvk30
    Oct 1 '18 at 7:06










  • Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
    – sɐunıɔןɐqɐp
    Oct 1 '18 at 7:23










  • If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
    – Mbanda
    Oct 1 '18 at 13:13












  • @Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
    – kvk30
    Dec 27 '18 at 16:37
















I need to run port 4080
– kvk30
Oct 1 '18 at 7:06




I need to run port 4080
– kvk30
Oct 1 '18 at 7:06












Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
– sɐunıɔןɐqɐp
Oct 1 '18 at 7:23




Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: How do I write a good answer?. Thanks
– sɐunıɔןɐqɐp
Oct 1 '18 at 7:23












If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
– Mbanda
Oct 1 '18 at 13:13






If things dont work out this way, leave it like nodemon server.js then in your terminal say export port=4080 (your choice port of course) then npm nodemon to start the server
– Mbanda
Oct 1 '18 at 13:13














@Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
– kvk30
Dec 27 '18 at 16:37




@Mbanda Thanks for sharing your knowledge, unfortunately, I solved it and not tested with your explanation.
– kvk30
Dec 27 '18 at 16:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47806623%2funrecognized-port-command%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Angular Downloading a file using contenturl with Basic Authentication

Olmecas

Can't read property showImagePicker of undefined in react native iOS