Unrecognized PORT command

前端 未结 7 1899
离开以前
离开以前 2021-02-14 04:22

In my localhost, running below command

PORT=4080 node server.js

But, it was throwing an unexpected error.

\'PORT\' is no

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-14 05:25

    • 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.

提交回复
热议问题