Comments (10)
你给这些信息应该不足以让开发者debug吧?
from detect-port.
node 版本: v7.7.2
还需要哪些信息?
from detect-port.
from detect-port.
Mac OSX 10.12
from detect-port.
@yibn2008 1024 之前的端口是系统保留端口,执行权限不够,你可以尝试从大一些的端口开始。
from detect-port.
@xudafeng 有一个模块可以做到 https://github.com/stdarg/tcp-port-used, 我原来就是用这个模块, 只不过这个模块在 node 7.7 下因为 socket.connect 参数的问题, 导致出错了, 所以想尝试下 detect-port
from detect-port.
如果 detect-port 不打算做的话, 我就自己 fork 一个算了
from detect-port.
@yibn2008 准确的说,detect-port 是尝试寻找可用的端口,而不是未被占用的端口。80 端口即使未被占用,非管理员权限通常也不能使用,所以这不是 detect-port 的错。如果 >1024 的端口也存在问题,那就有可能是 bug。方便的话,你可以试一下 portman,告诉我结果。
from detect-port.
@YounGoat 哦 ... 快一年多了. 嗯, 我已经开发了一个模块 find-process, 支持检测 80 端口占用.
说到底, 还是机制的问题. 用 listen 去做, 当然会有权限问题了. 有另外一个模块, tcp-port-used 是支持在非 root 权限下检测 80 端口的, 它的原理是用 socket 去连, 不过在 Mac 上会有些 bug, 不一定准确.
目前看来, 通过 netstat 去判断是最为准确的, 这也是 find-process 选择的方式.
from detect-port.
小于 1024 的端口都需要 root 权限的,这是基本常识。
如你需要真正探测 80 端口,那么你需要让当前用户变成 root,如加 sudo
sudo detect-port 80
from detect-port.
Related Issues (16)
- 端口检测程序是否有问题? HOT 1
- Is it possible to use next available port? HOT 2
- Library not detecting port is in use HOT 5
- Add ability to specify a hostname HOT 6
- detect error when localhost is not binding
- Does not work on windows' git bash HOT 2
- Claims all ports occupied on macOS high sierra HOT 6
- Freezes for a minute when OS X Firewall is enabled
- 无论哪个端口都被探测到已被占用,例如8989,进程中查询不到 HOT 3
- A problem with an installation via NPM HOT 14
- All port was occupied ? HOT 2
- address.ip is undefined when trying to use via NPM package HOT 2
- Not working on WSL (Windows Subsystem for Linux)
- Upgrade debug dependency to 4.3.1+ HOT 1
- Warnings displayed when running detect-port HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detect-port.