nodejs webapp works locally but not live/deployed - node.js

My webapp works locally, but when I attempt to publish it on Azure Web Apps the following error pops up. It is showing Error: listen EADDRINUSE: address already in use :::8080, but the webapp should be using port 3000. I am new to creating webapp, so any help with be appreciated. I used visual studio code to publish the webapp following these settings - https://learn.microsoft.com/en-us/azure/developer/javascript/tutorial-vscode-azure-app-service-node-03. I chose linux and node 12 LTS.
Thank you!
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('myapp:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
2020-07-16T04:23:44.555179603Z / _ \ __________ _________ ____
2020-07-16T04:23:44.555185003Z / /_\ \___ / | \_ __ \_/ __ \
2020-07-16T04:23:44.555189203Z / | \/ /| | /| | \/\ ___/
2020-07-16T04:23:44.555193303Z \____|__ /_____ \____/ |__| \___ >
2020-07-16T04:23:44.555197403Z \/ \/ \/
2020-07-16T04:23:44.555201303Z A P P S E R V I C E O N L I N U X
2020-07-16T04:23:44.555205203Z
2020-07-16T04:23:44.555208803Z Documentation: http://aka.ms/webapp-linux
2020-07-16T04:23:44.555212503Z NodeJS quickstart: https://aka.ms/node-qs
2020-07-16T04:23:44.555216303Z NodeJS Version : v12.16.3
2020-07-16T04:23:44.555220003Z Note: Any data outside '/home' is not persisted
2020-07-16T04:23:44.555223903Z
2020-07-16T04:23:44.902776147Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2020-07-16T04:23:44.912621757Z Build Operation ID: |bLCEuDLkBSY=.df68a68e_
2020-07-16T04:23:46.477381888Z Writing output script to '/opt/startup/startup.sh'
2020-07-16T04:23:47.136900207Z Running #!/bin/sh
2020-07-16T04:23:47.137528808Z
2020-07-16T04:23:47.137541508Z # Enter the source directory to make sure the script runs where the user expects
2020-07-16T04:23:47.137547108Z cd "/home/site/wwwroot"
2020-07-16T04:23:47.137551508Z
2020-07-16T04:23:47.137555608Z export NODE_PATH=$(npm root --quiet -g):$NODE_PATH
2020-07-16T04:23:47.138703711Z if [ -z "$PORT" ]; then
2020-07-16T04:23:47.138716311Z export PORT=8080
2020-07-16T04:23:47.138721811Z fi
2020-07-16T04:23:47.138725911Z
2020-07-16T04:23:47.139711413Z echo Found tar.gz based node_modules.
2020-07-16T04:23:47.139723313Z extractionCommand="tar -xzf node_modules.tar.gz -C /node_modules"
2020-07-16T04:23:47.139728913Z echo "Removing existing modules directory from root..."
2020-07-16T04:23:47.139733513Z rm -fr /node_modules
2020-07-16T04:23:47.139737613Z mkdir -p /node_modules
2020-07-16T04:23:47.139741713Z echo Extracting modules...
2020-07-16T04:23:47.141077216Z $extractionCommand
2020-07-16T04:23:47.141089216Z export NODE_PATH="/node_modules":$NODE_PATH
2020-07-16T04:23:47.141094416Z export PATH=/node_modules/.bin:$PATH
2020-07-16T04:23:47.141098616Z if [ -d node_modules ]; then
2020-07-16T04:23:47.142105319Z mv -f node_modules _del_node_modules || true
2020-07-16T04:23:47.142117019Z fi
2020-07-16T04:23:47.142122019Z
2020-07-16T04:23:47.142126219Z if [ -d /node_modules ]; then
2020-07-16T04:23:47.142140519Z ln -sfn /node_modules ./node_modules
2020-07-16T04:23:47.142145419Z fi
2020-07-16T04:23:47.149224835Z
2020-07-16T04:23:47.149263335Z echo "Done."
2020-07-16T04:23:47.149334335Z npm start
2020-07-16T04:23:48.155357951Z Found tar.gz based node_modules.
2020-07-16T04:23:48.155942252Z Removing existing modules directory from root...
2020-07-16T04:23:48.164530572Z Extracting modules...
2020-07-16T04:23:51.370781353Z Done.
2020-07-16T04:23:52.204989273Z npm info it worked if it ends with ok
2020-07-16T04:23:52.206185276Z npm info using npm#6.14.4
2020-07-16T04:23:52.206929677Z npm info using node#v12.16.3
2020-07-16T04:23:52.736398696Z npm info lifecycle myapp#0.0.0~prestart: myapp#0.0.0
2020-07-16T04:23:52.746327019Z npm info lifecycle myapp#0.0.0~start: myapp#0.0.0
2020-07-16T04:23:52.759340349Z
2020-07-16T04:23:52.759356549Z > myapp#0.0.0 start /home/site/wwwroot
2020-07-16T04:23:52.759362549Z > node ./bin/www
2020-07-16T04:23:52.759366849Z
2020-07-16T04:23:54.160267671Z Express server listening on port 8080
2020-07-16T04:23:54.170115279Z events.js:287
2020-07-16T04:23:54.170141079Z throw er; // Unhandled 'error' event
2020-07-16T04:23:54.170147979Z ^
2020-07-16T04:23:54.170152379Z
2020-07-16T04:23:54.170156779Z Error: listen EADDRINUSE: address already in use :::8080
2020-07-16T04:23:54.170161379Z at Server.setupListenHandle [as _listen2] (net.js:1313:16)
2020-07-16T04:23:54.170165779Z at listenInCluster (net.js:1361:12)
2020-07-16T04:23:54.170170179Z at Server.listen (net.js:1449:7)
2020-07-16T04:23:54.170174479Z at module.exports (/home/site/wwwroot/routes/table_routes2.js:63:27)
2020-07-16T04:23:54.170178979Z at Object. (/home/site/wwwroot/app.js:119:37)
2020-07-16T04:23:54.170183679Z at Module._compile (internal/modules/cjs/loader.js:1133:30)
2020-07-16T04:23:54.170187979Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
2020-07-16T04:23:54.170192279Z at Module.load (internal/modules/cjs/loader.js:977:32)
2020-07-16T04:23:54.170196679Z at Function.Module._load (internal/modules/cjs/loader.js:877:14)
2020-07-16T04:23:54.170200879Z at Module.require (internal/modules/cjs/loader.js:1019:19)
2020-07-16T04:23:54.170205179Z at require (internal/modules/cjs/helpers.js:77:18)
2020-07-16T04:23:54.170209379Z at Object. (/home/site/wwwroot/bin/www:7:11)
2020-07-16T04:23:54.170213779Z at Module._compile (internal/modules/cjs/loader.js:1133:30)
2020-07-16T04:23:54.170218079Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
2020-07-16T04:23:54.170231979Z at Module.load (internal/modules/cjs/loader.js:977:32)
2020-07-16T04:23:54.170236679Z at Function.Module._load (internal/modules/cjs/loader.js:877:14)
2020-07-16T04:23:54.170240879Z Emitted 'error' event on Server instance at:
2020-07-16T04:23:54.170244979Z at emitErrorNT (net.js:1340:8)
2020-07-16T04:23:54.170248979Z at processTicksAndRejections (internal/process/task_queues.js:84:21) {
2020-07-16T04:23:54.170253279Z code: 'EADDRINUSE',
2020-07-16T04:23:54.170257279Z errno: 'EADDRINUSE',
2020-07-16T04:23:54.170261279Z syscall: 'listen',
2020-07-16T04:23:54.170265279Z address: '::',
2020-07-16T04:23:54.170269379Z port: 8080
2020-07-16T04:23:54.170273379Z }
2020-07-16T04:23:54.198841600Z npm info lifecycle myapp#0.0.0~start: Failed to exec start script
2020-07-16T04:23:54.200937601Z npm ERR! code ELIFECYCLE
2020-07-16T04:23:54.201865802Z npm ERR! errno 1
2020-07-16T04:23:54.203466603Z npm ERR! myapp#0.0.0 start: `node ./bin/www`
2020-07-16T04:23:54.203976603Z npm ERR! Exit status 1
2020-07-16T04:23:54.204590604Z npm ERR!
2020-07-16T04:23:54.205116404Z npm ERR! Failed at the myapp#0.0.0 start script.
2020-07-16T04:23:54.211395609Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-07-16T04:23:54.346290903Z npm timing npm Completed in 2399ms
2020-07-16T04:23:54.347057103Z
2020-07-16T04:23:54.347655604Z npm ERR! A complete log of this run can be found in:
2020-07-16T04:23:54.436761954Z npm ERR! /root/.npm/_logs/2020-07-16T04_23_54_212Z-debug.log

try without normalizeport function

Related

Unable to get information using https second time(Error: write EPROTO ... final_renegotiate:unsafe legacy renegotiation disabled)

I developed a server which works fine on my system. Then I got a VPS(Virtual Private Server) from my university to deploy the server there too!
To deploy my server on VPS I used docker but I got a strange result when I ran it! I debug the program and find where problem is but I don't know why it occurs and how to fix it.
I use a remote database to get safe primes. First time I get the information without any problem but when server tries to connect to the database for second time, it gets below error:
node:events:498
throw er; // Unhandled 'error' event
^
Error: write EPROTO 80B9B7E0587F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:907:
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on ClientRequest instance at:
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -71,
code: 'EPROTO',
syscall: 'write'
}
Node.js v17.4.0
npm notice
npm notice New minor version of npm available! 8.3.1 -> 8.5.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.5.2>
npm notice Run `npm install -g npm#8.5.2` to update!
npm notice
The simplified server I used to test:
const express = require('express');
const debug = require('debug');
const https = require('https')
const log = debug('app::main-Interface');
const args = process.argv.slice(2);
const app = express();
const port = args[0] || process.env.port || 3000;
function sleep(toSleep){
return new Promise((resolve, reject)=>{
setTimeout(() => {
resolve(true)
}, toSleep);
})
}
async function initializeRemotely(lengthOfOrder = 4096){
return new Promise((resolve, reject)=>{
https.get(`https://2ton.com.au/getprimes/random/${lengthOfOrder}`,
(res)=>{
res.on('data', async (data)=>{
log('Data received!')
resolve(true);
})
}
)
})
}
async function DEBUG(){
let breakTime = 5000;
while(true){
await initializeRemotely()
log('First operation succeed')
await sleep(breakTime);
breakTime *= 2;
}
}
app.listen(port, async () => {
log(`Server started listening on port : ${port}`);
//schedulerPool.MSRulesWatcher(config.get('Times.schedulers'));
DEBUG()
});
I run this code on my system using below command line:
$ DEBUG=app::* node server.js
app::main-Interface Server started listening on port : 3000 +0ms
app::main-Interface Data received! +2s
app::main-Interface First operation succeed +4ms
app::main-Interface Data received! +6s
app::main-Interface First operation succeed +1ms
app::main-Interface Data received! +11s
app::main-Interface First operation succeed +2ms
^C
As you can see it works fine!
The docker file I use to deploy the server is as below(./deploy/Dockerfile):
FROM node:alpine
EXPOSE 3000
WORKDIR /interface
COPY package.json .
RUN npm install
COPY . .
And the content of ./docker-compose.yml:
version: "3"
services:
interface:
image: interface
container_name: interface
build:
context: .
dockerfile: ./deploy/Dockerfile
entrypoint: ["npm", "run", "development"]
Then I run the docker image in VPS using below commands:
$ sudo docker-compose build
$ sudo docker-compose up -d
And the log of server is shown below:
$ sudo docker logs [container-name]
> export NODE_ENV=development; export DEBUG=app:*; node server.js
2022-02-25T17:06:37.963Z app::main-Interface Server started listening on port : 3000
2022-02-25T17:06:40.992Z app::main-Interface Data received!
2022-02-25T17:06:40.998Z app::main-Interface First operation succeed
node:events:498
throw er; // Unhandled 'error' event
^
Error: write EPROTO 80B991E6EB7F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:907:
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
Emitted 'error' event on ClientRequest instance at:
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -71,
code: 'EPROTO',
syscall: 'write'
}
Node.js v17.4.0
npm notice
npm notice New minor version of npm available! 8.3.1 -> 8.5.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.5.2>
npm notice Run `npm install -g npm#8.5.2` to update!
npm notice
Which indicates server can connect to the database first time but second time it gets this error.
MY QUESTIONS:
First of all, I'm really curious to find out why this problem occurs?
How can I fix it?
INFORMATION
VPS information:
$ uname -a
Linux vote 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
My system information:
$ uname -a
Linux milad-pc 5.4.178-1-MANJARO #1 SMP PREEMPT Tue Feb 8 20:03:41 UTC 2022 x86_64 GNU/Linux

How do i specify the path in node/express correctly to read my certificate files?

This is my file structure simplified
app-folder
-> dist
-> server.js
-> src
-> server.ts
-> key.pem
-> cert.pem
This is the simplified content of the server.ts file to read the certificate files
import fs from 'fs';
const options = {
key: fs.readFileSync('../key.pem'),
cert: fs.readFileSync('../cert.pem')
};
This is the error i am getting
server | internal/fs/utils.js:307
server | throw err;
server | ^
server |
server | Error: ENOENT: no such file or directory, open '../key.pem'
server | at Object.openSync (fs.js:476:3)
server | at Object.readFileSync (fs.js:377:35)
server | at Object.<anonymous> (/usr/src/app/dist/server.js:18:23)
server | at Module._compile (internal/modules/cjs/loader.js:1063:30)
server | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
server | at Module.load (internal/modules/cjs/loader.js:928:32)
server | at Function.Module._load (internal/modules/cjs/loader.js:769:14)
server | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
server | at internal/main/run_main_module.js:17:47 {
server | errno: -2,
server | syscall: 'open',
server | code: 'ENOENT',
server | path: '../key.pem'
server | }
server exited with code 1
I created the key and certificate following this
tutorial
Hoangdv pointed out that i use docker which is correct this is my Dockerfile:
FROM node:14
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
RUN npm install -g nodemon
# Install dependencies
COPY package.json .
RUN npm install
# Bundle app source
COPY . .
RUN npx tsc
EXPOSE 8080
Does COPY . . not copy the certificates already?
Relative paths will be resolved relative to the current working directory as determined by calling process.cwd().
--- node.js docs
import fs from 'fs';
import path from 'path';
const options = {
key: fs.readFileSync(path.resolve(__dirname, '../key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, '../cert.pem'))
};
Try,
var resolve = require('path').resolve
key : resolve('../key.pem')
cert : resolve('../cert.pem')

Node.js child_process has no access to global modules

I have installed a npm packages globally in my Kubuntu 19.04
$ npm install -g cordova
/home/username/.npm-global/bin/cordova -> /home/username/.npm-global/lib/node_modules/cordova/bin/cordova
+ cordova#9.0.0
updated 1 package in 7.299s
I can access it from shell
$ cordova -v
9.0.0 (cordova-lib#9.0.1)
But I can't access it from a simple node script with spawn:
const { spawn } = require( 'child_process' );
const cmd = spawn( 'cordova', [ '-v' ] );
cmd.stdout.on( 'data', data => {
console.log( `stdout: ${data}` );
} );
Running it results in the following:
$ node test1.js
events.js:298
throw er; // Unhandled 'error' event
^
Error: spawn cordova ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn cordova',
path: 'cordova',
spawnargs: [ '-v' ]
}
But when using absolute path:
const { spawn } = require( 'child_process' );
const cmd = spawn( '/home/username/.npm-global/bin/cordova', [ '-v' ] );
cmd.stdout.on( 'data', data => {
console.log( `stdout: ${data}` );
} );
I get the expected result:
$ node test1.js
stdout: 9.0.0 (cordova-lib#9.0.1)
My script above is just a testcase, since I have problem to add/run cordova specific stuff in vue-cli-plugin-cordova and quasar. I tracked it down, that the global path is the problem.
Update
I think I found the problem, but not sure how to solve it. When setting /bin/bash as shell, it works:
cmd = spawn('cordova', ['-v'], {
shell: '/bin/bash'
});
Not sure, why this is needed and why the packages vue-cli-plugin-cordova and quasar don't do it.
Ok, after hours of research and tryouts, I have uninstalled node, installed nvm and latest node, set
nvm use --delete-prefix v13.7.0 --silent >> /dev/null
and added this to ~/.bashrc
and now everything works
how I solve my error, I changed the environment variable PATH: to C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}
which is
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\nodejs
in my PATH

How to connect a Node.js TCP-client in container A to a TCP-server in container B with Docker Compose?

I am trying to connect a TCP-client in container A to a TCP-server in container B. Running docker-compose up results in a ECONNREFUSED error on the client side. 为什么呢?
The TCP-client looks like this:
var net = require('net');
var client = new net.Socket();
client.connect(1337, function() {
console.log('Connected');
client.write('Hello, server! Love, Client.');
});
client.on('data', function(data) {
console.log('Received: ' + data);
// client.destroy(); // kill client after server's response
});
client.on('close', function() {
console.log('Connection closed');
});
The TCP-client Dockerfile looks like this:
FROM node:latest
RUN mkdir /app
WORKDIR /app
ADD . /app
ADD package.json /app
RUN npm install
EXPOSE 1337
ENV PATH /app/node_modules/.bin:$PATH
CMD npm start
The TCP-server looks like this:
var net = require('net');
var server = net.createServer(function(socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});
server.listen(1337);
The TCP-server Dockerfile looks like this:
FROM node:latest
RUN mkdir /app
WORKDIR /app
ADD . /app
ADD package.json /app
RUN npm install
EXPOSE 1337
ENV PATH /app/node_modules/.bin:$PATH
CMD npm start
The docker-compose.yml looks like this:
version: "3"
services:
tcpclient:
build: ./tcpclient
ports:
- "8000:8000"
depends_on:
- tcpserver
tcpserver:
build: ./tcpserver
ports:
- "8001:1337"
The connection error looks like this:
tcpclient_1 | > http-service#1.0.0 start /app
tcpclient_1 | > node tcpclient.js
tcpclient_1 |
tcpclient_1 | events.js:137
tcpclient_1 | throw er; // Unhandled 'error' event
tcpclient_1 | ^
tcpclient_1 |
tcpclient_1 | Error: connect ECONNREFUSED 127.0.0.1:1337
tcpclient_1 | at Object._errnoException (util.js:1003:13)
tcpclient_1 | at _exceptionWithHostPort (util.js:1024:20)
tcpclient_1 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1194:14)
tcpclient_1 | npm ERR! code ELIFECYCLE
Help would be greatly appreciated
Multiple problems here.
I'm not sure localhost from a container will be in the same interface than your host. Moreover, the port bound is 8001. But, I would recomand another approach:
Using link you can reference other containers hosts with their name.
I would try to:
1) Add in tcpclient container definition:
links:
- tcpserver
2) Keep 1337:1337 in tcp server (why is client exposing a TCP port btw ?)
3) use client.connect(1337, 'tcpserver', function(...){...}

Getting Error: spawn ./node_modules/.bin/grunt ENOENT when running grunt

I have a project that is started in development by
yarn start
It runs a index.js that starts a grunt process and get this error:
$ yarn start
yarn start v0.23.2
$ node ./development
grunt_arguments [ '--force', '--notify', '--verbose', '--debug', '--stack' ]
=======================================
Open http://localhost:8000 to start developing
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn ./node_modules/.bin/grunt ENOENT
at exports._errnoException (util.js:907:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:32)
at onErrorNT (internal/child_process.js:355:16)
at nextTickCallbackWith2Args (node.js:458:9)
at process._tickCallback (node.js:372:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:139:18)
at node.js:990:3
error Command failed with exit code 1.
No idea what can it be. Environment is:
Win10
Running with MINGW64
I usually monkey patch child_process to help me debug that kind of issues. Add something like this in the beginning of your index.js file:
const util = require('util')
const childProcess = require("child_process");
const originalSpawn = childProcess.spawn;
childProcess.spawn = function() {
console.trace('SPAWN');
console.log('ARGS');
console.log(util.inspect(arguments, false, null)); // showHidden = false, depth = null
return originalSpawn.apply(this, arguments);
};
If your run, childProcess.spawn('ls', ['-lh', '/usr']) you will see something like:
Trace: SPAWN
at Object.childProcess.spawn (repl:2:9)
at myFunction (repl:2:14)
at repl:1:1
at REPLServer.defaultEval (repl.js:164:27)
at bound (domain.js:250:14)
at REPLServer.runBound [as eval] (domain.js:263:12)
at REPLServer.<anonymous> (repl.js:392:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
ARGS
{ '0': 'ls', '1': [ '-lh', '/usr' ] }
Maybe after running it you can update your question with the new information.

Resources