june@june-Satellite-C600:~/nodejs/lesson$noderandom.js
RandomNumberGeneratorRunning…
events.js:72
thrower;//Unhandled'error'event
^
Error:listenEACCES
aterrnoException(net.js:904:11)
atServer._listen2(net.js:1023:19)
atlisten(net.js:1064:10)
atServer.listen(net.js:1138:5)
atObject.<anonymous>(/home/june/nodejs/lesson/random.js:50:8)
atModule._compile(module.js:456:26)
atObject.Module._extensions..js(module.js:474:10)
atModule.load(module.js:356:32)
atFunction.Module._load(module.js:312:12)
atFunction.Module.runMain(module.js:497:10)
There are two ways to solve the problem
1:sudo node *.js —–> Root authority solution
2: Set the port number above 1024 in the code; Because Linux monitors & lt; 1024 port needs root permission, > No need
Similar Posts:
- throw er; // Unhandled ‘error’ event
- Throw Er of node error// Unhandled ‘error’ event solution
- Error: listen EADDRINUSE :::3000
- Error: listen eaddinuse: 4000 [How to Solve]
- After installing nodejs, running NPM – V will cause (module. JS: 339 throw err..) error. Solution
- Solution to the failure of node rdkafka in docker build
- [Solved] Nodejs Error: Cannot find module ‘express’
- Completely Uninstall Node.js from Mac OS X
- Failed to create symbolic link ‘/usr/bin/utserver’: File exists with Error: Cannot find…
- NPM Install vue-cli Error: internal/modules/cjs/loader.js (Error: Cannot find module ‘D:\Program\nodejs\node_global\node_modules\vue-cli\bin\vue’)