Unrecognized PORT command

前端 未结 7 1536
没有蜡笔的小新
没有蜡笔的小新 2021-02-14 04:43

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:26

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

提交回复
热议问题