question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when starting dev server permission denied 127.0.0.1:3000

See original GitHub issue

Describe the bug

The OS seems to slam down the dev server when it tries to run.

Important to note that http-server on 8080 and node express apps on 3000 launch without a problem on the same VDI

Error:

demo@0.0.0 dev vite error when starting dev server: Error: listen EACCES: permission denied 127.0.0.1:3000 at Server.setupListenHandle [as _listen2] (node:net:1317:21) at listenInCluster (node:net:1382:12) at doListen (node:net:1520:7) at processTicksAndRejections (node:internal/process/task_queues:84:21) The terminal process “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run dev” terminated with exit code: 1.

If need to flip a permission, I just need to know which one.

Thanks,

Rob

Reproduction

Open vscode

Open folder (then create one on-the-fly)

Open a terminal

npm init vitejs@latest . enter enter npm install npm run dev

System Info

**Environment**
Citrix VDI
Microsoft Windows [Version 10.0.19042.1348]
running vitejs@latest as 2021-11-22
VSCode: 1.62.2
Template: vanilla
Node version: v17.1.0

**PowerShell info**
$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.19041.1320
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1320
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

When I run the dev server from CMD I get a similar error.

Used Package Manager

npm

Logs

Is there an actual log file? The output from the terminal windows is below:
> vite --debug        

  vite:config no config file found. +0ms
  vite:config using resolved config: {
  vite:config   root: 'Z:/var/gist/7132/wksp_web/test-vite_04',       
  vite:config   base: '/',
  vite:config   mode: 'development',
  vite:config   configFile: undefined,
  vite:config   logLevel: undefined,
  vite:config   clearScreen: undefined,
  vite:config   server: { fs: { strict: undefined, allow: [Array] } },
  vite:config   configFileDependencies: [],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     server: { fs: [Object] }
  vite:config   },
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: 'Z:\\var\\gist\\7132\\wksp_web\\test-vite_04\\public',
  vite:config   cacheDir: 'Z:\\var\\gist\\7132\\wksp_web\\test-vite_04\\node_modules\\.vite',
  vite:config   command: 'serve',
  vite:config   isProduction: false,
  vite:config   plugins: [
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-script-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:client-inject',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   }
  vite:config } +21ms
  vite:deps Hash is consistent. Skipping. Use --force to override. +0ms
error when starting dev server:
Error: listen EACCES: permission denied 127.0.0.1:3000
    at Server.setupListenHandle [as _listen2] (node:net:1317:21)
    at listenInCluster (node:net:1382:12)
    at doListen (node:net:1520:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run debug-dev" terminated with exit code: 1.

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
GoldSubmarinecommented, Nov 27, 2021

I have encountered the same problem and solved by the following methods.

  1. Open PowerShell as Admin.
  2. stop winnat with command: net stop winnat
  3. start winnat again with command: net start winnat

References: https://stackoverflow.com/questions/60485038/ng-server-listen-eacces-permission-denied-127-0-0-14200

0reactions
sapphi-redcommented, Jun 14, 2022

I am closing this issue because I believe this is caused by something specific to your VDI setup.

Please create a discussion if you need help. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng server - listen EACCES: permission denied 127.0.0.1:4200
I have solved this issue by simply going to Control Panel\Network and Internet\Network Connections and then I disabled all the Hyper-V ...
Read more >
How to fix `listen EACCES: permission denied` on any port
In my case the error appears because the port used belong to reserved ports for Hyper-V. This port range changes when I restart...
Read more >
Macos Big Sur port 80 permission denied with root
For years I have been running a local node.js server on port 80 with. sudo npm run. After upgrading npm to 7.6.3 from...
Read more >
How To Handle `Error: EACCES: permission denied`
The Solution. The best solution I have found to resolve this error is as follows: Open PowerShell as Admin and stop winnat with...
Read more >
Web Server won't deploy - Render community
... a bit different I want to deploy the vite local dev server in production. ... Aug 12 03:53:28 PM Error: listen EACCES:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found