我使用Yeoman使用bower和grunt构建一个角度应用程序.运行grunt服务给了我这个错误:
Running "connect:livereload" (connect) task Fatal error: Port 9000 is already in use by another process.
我有另一个使用端口9000的进程,所以我想改变Grunt的端口.我试图改变我的Gruntfile中的端口,但我继续得到同样的错误.以下是Gruntfile.js中的grunt服务器设置
connect: { options: { port: 9002,hostname: 'localhost',livereload: 35729 },
解决方法
找到使用该端口的进程ID:
sudo lsof -i :3000
杀死它:
kill -9 <PID>