× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am attempting to create a hello world app from this developerworks
article:
https://www.ibm.com/developerworks/ibmi/library/i-native-js-app-ibmi-with-nodejs/

step 3 values:
$
node -v
v6.11.5
$
npm -v
3.10.10
$

my js file: called sample.js, CCSID = 37
************Beginning of data**************
var http = require('http');
var ip = "xxx.xxx.xxx.xxx" ;
var port = 53591 ;
var webserver = http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World with node\n');
});
webserver.listen(port, ip);
console.log('Server running at http://' + ip + ':' + port);
************End of Data********************

when I tried to run node:

node '/home/gmagnuson/sample.js'

/home/gmagnuson/sample.js:1

(function (exports, require, module, __filename, __dirname) {
���@����@~@�������M}����}]^
^



SyntaxError: Invalid or unexpected token

at createScript (vm.js:56:10)

at Object.runInThisContext (vm.js:97:10)

at Module._compile (module.js:542:28)

at Object.Module._extensions..js (module.js:579:10)

at Module.load (module.js:487:32)

at tryModuleLoad (module.js:446:12)

at Function.Module._load (module.js:438:3)

at Module.runMain (module.js:604:10)

at run (bootstrap_node.js:383:7)

at startup (bootstrap_node.js:149:9)

$

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.