EACCES permission denied error

This morning I am faced with a strange error. I updated Node and also tried a new app with “au build” but I get the following error:

PS C:\DevTest\Aurelia\test13> au run
Local aurelia-cli v1.3.1
Starting 'readProjectConfiguration'...
INFO [Bundle] Manually adding package: 2.3.3      aurelia-bootstrapper
INFO [Bundle] Manually adding package: 1.2.1      aurelia-loader-default
INFO [Bundle] Manually adding package: 1.8.1      aurelia-pal-browser
INFO [Bundle] Manually adding package: 1.0.0      aurelia-testing
INFO [Bundle] Manually adding package: 2.0.16     text
Finished 'readProjectConfiguration'
Starting 'processMarkup'...
Starting 'processJson'...
Starting 'processCSS'...
Starting 'copyFiles'...
Starting 'configureEnvironment'...
Finished 'copyFiles'
Finished 'processJson'
Finished 'processCSS'
Finished 'processMarkup'
Finished 'configureEnvironment'
Starting 'buildTypeScript'...
Finished 'buildTypeScript'
Starting 'writeBundles'...
INFO [Bundler] Tracing files ...
INFO [Bundler] Auto tracing package: 1.0.3      aurelia-event-aggregator
INFO [Bundler] Auto tracing package: 1.3.1      aurelia-framework
INFO [Bundler] Auto tracing package: 1.4.0      aurelia-history-browser
INFO [Bundler] Auto tracing package: 1.0.2      aurelia-loader
INFO [Bundler] Auto tracing package: 1.1.1      aurelia-logging-console
INFO [Bundler] Auto tracing package: 1.0.6      aurelia-metadata
INFO [Bundler] Auto tracing package: 1.8.2      aurelia-pal
INFO [Bundler] Auto tracing package: 1.3.4      aurelia-polyfills
INFO [Bundler] Auto tracing package: 1.5.3      aurelia-templating-binding
INFO [Bundler] Auto tracing package: 1.13.0     aurelia-templating-resources
INFO [Bundler] Auto tracing package: 1.4.0      aurelia-templating-router
INFO [Bundler] Auto tracing package: 2.5.4      aurelia-binding
INFO [Bundler] Auto tracing package: 1.5.2      aurelia-dependency-injection
INFO [Bundler] Auto tracing package: 1.2.1      aurelia-history
INFO [Bundler] Auto tracing package: 1.5.2      aurelia-logging
INFO [Bundler] Auto tracing package: 1.1.5      aurelia-path
INFO [Bundler] Auto tracing package: 1.7.1      aurelia-router
INFO [Bundler] Auto tracing package: 1.3.3      aurelia-task-queue
INFO [Bundler] Auto tracing package: 1.10.3     aurelia-templating
INFO [Bundler] Auto tracing package: 1.3.2      aurelia-route-recognizer
INFO [Bundle] Writing app-bundle.js...
INFO [Bundle] Writing vendor-bundle.js...
Finished 'writeBundles'
Application Available At: http://localhost:9000
BrowserSync Available At: http://localhost:3001
events.js:287
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES: permission denied 0.0.0.0:3001
    at Server.setupListenHandle [as _listen2] (net.js:1296:21)
    at listenInCluster (net.js:1361:12)
    at Server.listen (net.js:1449:7)
    at Object.startServer [as fn] (C:\DevTest\Aurelia\test13\node_modules\browser-sync-ui\lib\async.js:123:39)
    at C:\DevTest\Aurelia\test13\node_modules\browser-sync-ui\lib\UI.js:184:14
    at iterate (C:\DevTest\Aurelia\test13\node_modules\async-each-series\index.js:8:5)
    at C:\DevTest\Aurelia\test13\node_modules\async-each-series\index.js:16:16
    at C:\DevTest\Aurelia\test13\node_modules\browser-sync-ui\lib\UI.js:192:13
    at Object.setUrlOptions [as fn] (C:\DevTest\Aurelia\test13\node_modules\browser-sync-ui\lib\async.js:76:9)
    at C:\DevTest\Aurelia\test13\node_modules\browser-sync-ui\lib\UI.js:184:14
Emitted 'error' event on Domain instance at:
    at Server.EventEmitter.emit (domain.js:500:12)
    at emitErrorNT (net.js:1340:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EACCES',
  errno: 'EACCES',
  syscall: 'listen',
  address: '0.0.0.0',
  port: 3001,
  domainEmitter: Server {
    insecureHTTPParser: undefined,
    _events: [Object: null prototype] {
      request: [Function],
      connection: [Array]
    },
    _eventsCount: 2,
    _maxListeners: undefined,
    _connections: 0,
    _handle: null,
    _usingWorkers: false,
    _workers: [],
    _unref: false,
    allowHalfOpen: true,
    pauseOnConnect: false,
    httpAllowHalfOpen: false,
    timeout: 120000,
    keepAliveTimeout: 5000,
    maxHeadersCount: null,
    headersTimeout: 40000,
    destroy: [Function],
    [Symbol(IncomingMessage)]: [Function: IncomingMessage],
    [Symbol(ServerResponse)]: [Function: ServerResponse],
    [Symbol(kCapture)]: false,
    [Symbol(asyncId)]: -1
  },
  domainThrown: false
}

I’ve checked port usage and 3001 is not in use on my Windows 10 computer. How do I fix this?

1 Like

Try closing all open windows/ides, with admin rights delete node_modules folder and run npm install again

1 Like

Same issue. I tried it on the newly created app.

1 Like

Is there a way to disable browser sync? Nothing is running on port 3001…

1 Like

I think you can configure the default port in the run task of aurelia_project

1 Like

It still runs on my laptop. Not sure what changed on my desktop. I’ve looked through the tasks and don’t see any configuration for port 3001.

1 Like

Damn I recently bought a new desktop PC with windows on it and remember having the same issue. Can’t for my life recall though what I did

1 Like

There is nothing running on that port so I don’t know what the problem is. For now I have setup a virtual directory in local IIS and I’m using au build + F5 since au run crashes. Hopefully someone will know how to fix this. I searched the web for 3 hours and found nothing helpful.

1 Like

I found that IIS Express leaves ports open far too often. I use bare Kestrel whenever possible as a result. Separately, I’ve found that hosting through webpack sometimes leaves me with a Node process hung up owning a port - killing all the Node processes overkill-style, including VSCode, will usually resolves it.

1 Like

I have not had this issue until today (been using the same config for months). I’ve restarted several times and only tried to run my app. I’ve used system tools to see what is using port 3001 and they report that nothing is using it. I suspect it is some sort of security glitch in one of the many moving parts. I don’t have IIS Express running.

1 Like

You can try to adjust browser-sync config to move the ports up to a bigger number.

If you want to remove browser-sync (it’s quite stale, and we don’t even use its main feature: ghost mode), try this:
I am removing browser-sync https://github.com/aurelia/new/pull/30/files
The similar change will be done to https://github.com/aurelia/v1 (the extracted skeleton from Aurelia CLI, will be used by aurelia-cli v2).

1 Like

@huochunpeng I’d rather not mess with the config as it is working well otherwise. The issue doesn’t affect the build, only running, which I can do manually. Perhaps the next release will straighten it out.

1 Like

Removing browser-sync is now merged onto Aurelia 1 skeleton.

You can create a new project with:

npx makes aurelia/v1

You can start using this command, as it will be the recommended way to create Aurelia 1 project. Future cli’s “au new” simply calls this command.

The idea of this new Aurelia 1 skeleton came from our previous work on Aurelia 2 skeleton (“npx makes aurelia” for Aurelia 2, which uses https://github.com/aurelia/new)

On top of decoupling skeleton files from aurelia-cli git repo (much smaller now), it also provides two lovely features:

  1. zero tool installation.
  2. always up-to-date skeleton (the master branch of https://github.com/aurelia/v1)
2 Likes

I have this a try. Very nice!

What does “always up-to-date” mean for an app?

Is there a way to update an existing app to use the new skeleton? Will you be adding something like “au upgrade”?

1 Like

It’s more of that au new will always use the latest variant without you having to update au itself

1 Like

I see. One of my apps is very large and it is a chore to have to “au new” to get the latest variant and then migrate over all the code and resources… an upgrade path of some sort would be nice. Or a way to “au new”, then copy the affected components (probably not realistic).

1 Like

I understand upgrading an existing app to latest skeleton is very troublesome.

It’s largely due to we expose lots of details (config) to the end users, so end users can customise the app setup in every possible way. Surely this had made upgrading difficult, because skeleton provider cannot assume the structure or config of an existing app.

On the other end, tools like parcel hide config as much as they could. That makes very easy to create an app and upgrade the tool. But users need to dig deeper to customise since the tool has lots of automatic behaviour in place.

BTW, we will have parcel and fusebox support for Aurelia 2.

Update: one thing we are doing with Aurelia 2 skeleton is to use plain standard npm scripts and keep the tooling layer as thin as possible.

npm start
npm test
npm run test:e2e
npm run build

For the replacement of cli-bundler, choose “custom” -> “dumber bundler” when doing npx makes aurelia.
You don’t need to learn aurelia.json, you customise things in gulpfile.js directly.
Bundling has been reduced to one single step in the gulp pipeline:

.pipe(dr())

The rest are handled outside of the bundler, like gulp-terser to minify the output, like standard nodejs http(s) server for dev-server, like gulp.watch for watch mode.

3 Likes

Awesome! Thanks for the detailed info. Excited about Aurelia 2!

1 Like