-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Current Behavior:
I am using webpack to bind a dev server to the privileged port 443
on an M1 Macbook Air (Apple Silicon) running the latest version of Big Sur. In order to bind to the privileged port, my npm start
script must be run with root permissions, so I execute sudo npm start
. Unfortunately, the root permissions do not carry into the execution, and my server fails to bind to port 443
and throws an error that is identical to the error thrown when run without sudo
:
✖ 「wds」: Error: listen EACCES: permission denied 127.0.0.1:443
at Server.setupListenHandle [as _listen2] (net.js:1301:21)
at listenInCluster (net.js:1366:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1503:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8) {
Expected Behavior:
I expect sudo npm run
to have no issues binding to port 443
because it has root permissions. This is how it behaves when I backdate npm to 6.14.12
.
Steps To Reproduce:
- Create an npm start script that tries to bind to a privileged port (e.g.
443
) - Run
npm start
with root permissions (e.g.sudo npm start
if on a Mac) - You should see an error
- Try binding to the same port directly in your terminal using root permissions
- You should not see an error
- Redo steps 1-3 using npm v6. Confirm no error is thrown.
I'm not sure how broad this issue is. Here are some open questions:
- Is this just related to binding to privileged ports?
- Is this just an M1 Apple Silicon problem?
- Is this just a Mac OS 11 problem?
- Is this an issue on all Mac OS versions?
- Is this an issue on all devices?
- Etc.
Environment:
- OS macOS Big Sur 11.2.3
- Node: 14.16.1
- npm: 7.10.0
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release