I am working on Ubuntu with incoming HTTP request from the following URL:
http://<MY-IP>:3000/v1/projects/list
Description: The problem is that I get the following error in terminal:
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
at new ClientRequest (_http_client.js:127:13)
at Object.request (https.js:300:10)
at Request.start (/home/dev/grem-api-dev/apiv3/node_modules/request/request.js:751:32)
at Request.end (/home/dev/grem-api-dev/apiv3/node_modules/request/request.js:1512:10)
at end (/home/dev/grem-api-dev/apiv3/node_modules/request/request.js:564:14)
at Immediate._onImmediate (/home/dev/grem-api-dev/apiv3/node_modules/request/request.js:578:7)
at processImmediate(timers.js:632:19)
After this error node process disappears from terminal (but still working and API response is sent properly), though I can't see whether it is working or not (image attached). So the only way to interact with node process is to do something like ps aux | grep node
or ps T
and manually kill process.
Assuming the error meaning I've found an appropriate code fragment where the error appears (request.js:751:32). Here it is:
try {
self.req = self.httpModule.request(reqOptions)
} catch (err) {
self.emit('error', err)
return
}
The only solution I've come to is to comment self.emit('error', err)
code line, which is obviously far from best practice.
The fact is the same code works on other computers (Ubuntu, Windows) with same components versions and no error occurs. Also API endpoints like http://myIp:3000/v1/community/list work fine on all devices.
Here's my component versions:
npm — 6.5.0,
node — 11.4.0,
request — 2.88.0,
Ubuntu — 16.04 (Windows — 10)
some code fragments if needed (Express Server creation and specific route in ProjectsController):
const app = express();
app.use('/v1/projects/', ProjectsController);
const router = express.Router();
router.post('/list', function(req,res){
//logic
});