You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I has been using PM2 to run and monit node process for a while and it works fine until I try to use babel.
I'm not sure what is the real problem, but when I starting a project with babel, it can't stop showing Port 3000 is already in use.
This project is a copy of another one. They are almost the same except scripts in package.json.
"scripts": { "start": "npm run babel | node ./bin/www", "babel": "./node_modules/.bin/babel server -d lib" }
and the original is much simpler
"scripts": { "start": "node ./bin/www" }
I use start the process by run process.json, and add "exec_interpreter": "babel-node" in the project with babel.
I also installed some new packages to the copy project including babel, babel-core, babel-loader, react, react-dom, react-hot-loader, webpack and webpack-dev-server. And I changed the code from ES5 to ES6 like that's why I use babel.(yes, I'm trying to use react and transfer to ES6 based on a normal express project)
When I reboot my mac and run the original project without babel, everything is fine. Then I stop the process and go on to start the project with babel, it keep throwing Port 3000 is already in use.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Google 394 brick 14u IPv6 0x432e592f22d3b26b 0t0 TCP localhost:52261->localhost:hbci (CLOSE_WAIT) Google 394 brick 16u IPv6 0x432e592f22d397ab 0t0 TCP localhost:52262->localhost:hbci (CLOSE_WAIT) Google 394 brick 213u IPv6 0x432e592f246f87ab 0t0 TCP localhost:52264->localhost:hbci (CLOSE_WAIT) node 1210 brick 13u IPv6 0x432e592f22d377ab 0t0 TCP *:hbci (LISTEN)
I use lsof -i:3000 in shell, it shows there's a node process and 2-3 named Google processes(I'm using chrome) is using the port. Even I killed the process, it reappears(with different pid).
I have no idea what's the problem.
The text was updated successfully, but these errors were encountered:
@soyuka Sorry, I tried the exec_interpreter:babel-node and the require hook, but it seems can't help with the port occupying problem. I'm using Express 4, the entry is ./bin/www, and I use pm2-dev run process.json to start it. I put the require hook in the top of the ./bin/www, and the process.json is like
I has been using PM2 to run and monit node process for a while and it works fine until I try to use babel.
I'm not sure what is the real problem, but when I starting a project with babel, it can't stop showing Port 3000 is already in use.
This project is a copy of another one. They are almost the same except scripts in package.json.
"scripts": {
"start": "npm run babel | node ./bin/www",
"babel": "./node_modules/.bin/babel server -d lib"
}
and the original is much simpler
"scripts": {
"start": "node ./bin/www"
}
I use start the process by
run process.json
, and add"exec_interpreter": "babel-node"
in the project with babel.I also installed some new packages to the copy project including babel, babel-core, babel-loader, react, react-dom, react-hot-loader, webpack and webpack-dev-server. And I changed the code from ES5 to ES6 like that's why I use babel.(yes, I'm trying to use react and transfer to ES6 based on a normal express project)
When I reboot my mac and run the original project without babel, everything is fine. Then I stop the process and go on to start the project with babel, it keep throwing Port 3000 is already in use.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 394 brick 14u IPv6 0x432e592f22d3b26b 0t0 TCP localhost:52261->localhost:hbci (CLOSE_WAIT)
Google 394 brick 16u IPv6 0x432e592f22d397ab 0t0 TCP localhost:52262->localhost:hbci (CLOSE_WAIT)
Google 394 brick 213u IPv6 0x432e592f246f87ab 0t0 TCP localhost:52264->localhost:hbci (CLOSE_WAIT)
node 1210 brick 13u IPv6 0x432e592f22d377ab 0t0 TCP *:hbci (LISTEN)
I use
lsof -i:3000
in shell, it shows there's a node process and 2-3 named Google processes(I'm using chrome) is using the port. Even I killed the process, it reappears(with different pid).I have no idea what's the problem.
The text was updated successfully, but these errors were encountered: