简体   繁体   English

npm开发Web服务器重启

[英]npm development web server restart

i'm learning react using a video course. 我正在学习使用视频课程的反应。 in the videos, the instructor does an npm start and every change he makes to the codebase after that is reflected immediately on the localhost:3000 . 在视频中,讲师会进行一次npm start ,此后他对代码库所做的每项更改都会立即反映在localhost:3000 However, each time I make a change, I have to kill the webserver and then restart it to see the changes. 但是,每次进行更改时,我都必须杀死Web服务器,然后重新启动它以查看更改。 Why is this happening? 为什么会这样呢? I have the latest version of stable node and both the instructor and myself are on OSX. 我拥有最新版本的稳定节点,并且教师和我本人都在OSX上。 I've since googled about the problem and several npm packages are available to address this issue, however, is it possible that on the instructor's this happens out of the box? 从那以后,我就一直在搜索该问题,并且可以使用几个npm软件包来解决此问题,但是,这是否有可能在教师的指导下开箱即用? please help i'd like to continue to learn react. 请帮助我想继续学习反应。

If you want to see the change, you will have to restart node.js server. 如果要查看更改,则必须重新启动node.js服务器。

If you want to restart server automatically, I recommand nodemon library!! 如果要自动重启服务器,我建议使用nodemon库!

https://github.com/remy/nodemon https://github.com/remy/nodemon

You can restart the server without having to do anything! 您无需执行任何操作即可重新启动服务器!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM