Skip to content
Thomas Schaffter edited this page Jul 28, 2019 · 4 revisions

Error: listen EADDRINUSE: address already in use 0.0.0.0:443

Cause: This error occurs when the server or client attempt to listen to a given port (here 443) but the port is already in use. This happens usually when the server or client have not properly stopped.

Solution: Get information about the process that use the port and kill it.

# lsof -i:443
COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
node    31873 root   23u  IPv4 1745477      0t0  TCP *:https (LISTEN)
# kill -9 31873

primus.js not found in production environment

$ npm run build
$ sudo -E node dist/server/
Using Primus App plugin
Server failed to start due to error: Error: ENOENT: no such file or directory, open '/home/tschaffter/dev/PHCCollaborationPortal/dist/client/components/socket/primus.js'

Check that the environment variables are correctly set for the production environment.

Error: EACCES: permission denied

Cause: For some reason, it happens that a file in the folder node_modules requires root access. This can lead to the following error when starting the portal:

$ npm run test

> phccp@0.0.1 test /home/tschaffter/dev/PHCCollaborationPortal
> gulp test

[21:53:45] Requiring external module @babel/register
fs.js:114
    throw err;
    ^

Error: EACCES: permission denied, open '/home/tschaffter/dev/PHCCollaborationPortal/node_modules/.cache/@babel/register/.babel.7.5.5.development.json'
  at Object.openSync (fs.js:443:3)
  at Object.writeFileSync (fs.js:1194:35)
  at save (/home/tschaffter/dev/PHCCollaborationPortal/node_modules/@babel/register/lib/cache.js:52:15)
  at process._tickCallback (internal/process/next_tick.js:61:11)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phccp@0.0.1 test: `gulp test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phccp@0.0.1 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tschaffter/.npm/_logs/2019-07-27T21_53_51_376Z-debug.log

Solution: Make the file accessible to the user who is running the portal:

sudo chown <user>:<user> path_to_the_file