× 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 did check lic pgm and had node 4, but not 6. Downloading now. I'll see what I can find on the nodever.sh

Thanks for the info.

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Kevin Turner
Sent: Tuesday, December 19, 2017 3:33 PM
To: 'IBMi Open Source Roundtable' <opensource@xxxxxxxxxxxx>
Subject: Re: [IBMiOSS] beginning node.js

So that is pretty ancient (in node.js terms).

You will need to install 5733OPS Option 6. If you already have it then you need to switch to using it. There is a shell script somewhere that enables you to switch between versions - can't remember where but I think it is called nodever.sh

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: 19 December 2017 20:29
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Subject: Re: [IBMiOSS] beginning node.js

Well, that shows V0.12.17

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Kevin Turner
Sent: Tuesday, December 19, 2017 3:25 PM
To: 'IBMi Open Source Roundtable' <opensource@xxxxxxxxxxxx>
Subject: Re: [IBMiOSS] beginning node.js

Sounds to me like you are using a node V6 sample/example but you have not got node 6 installed. You are probably using an older version. Try "node
-v" from a shell command line to check. Arrow functions have been valid
for a while so you must be on a really old version.

-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: 19 December 2017 20:05
To: opensource@xxxxxxxxxxxx
Subject: [IBMiOSS] beginning node.js

I'm trying to play a bit with Node.js when I have some spare time.
I'm currently trying to work my way through the tutorial at https://www.ibm.com/developerworks/ibmi/library/i-native-js-app-ibmi-with-no
dejs/index.html

I have made it up to the point where I try to connect to DB2.

So a couple of quick basic questions that I worked around, but wondered if someone could clarify.

On the statement
Var webserver = http.createServer((req,res) I cannot get it to work unless I change it to Var webserver = http.createServer(function(req,res).

Anyone know why?

Secondly the sample uses => in several sections of the code.
I cannot get it to work unless I remove these.


Now on to the db2 piece.
I've tried keying and copying/pasting removing the => and adding the function But I keep getting invalid tokens on the { after the fs.exists line.

So I tried to run step my way through it a piece at a time, but it doesn't seem to like the db = require('/QOpenSys...... line
var db =
require('/QOpenSys/QIBM/ProdData/OPS/Node6/os400/db2i/lib/db2a');
Error: Symbol resolution failed for
/QOpenSys/QIBM/ProdData/OPS/Node6/os400/db2i/bin/db2ia.node because:
Symbol
_ZN2v816FunctionTemplate12SetClassNameENS_5LocalINS_6StringEEE (number 74) is not exported from dependent
module node.
Symbol
_ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_
5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEi (number 77) is not exported from dependent
module node.
Symbol
_ZN2v82V88MakeWeakEPPNS_8internal6ObjectEPvPFvRKNS_16WeakCallbackInfoIvEEENS
_16WeakCallbackTypeE (number 80) is not exported from dependent
module node.
Symbol _ZN2v86Object3SetENS_5LocalINS_5ValueEEES3_ (number 89) is not exported from dependent
module node.
Symbol _ZN2v86Object3SetEjNS_5LocalINS_5ValueEEE (number 90) is not exported from dependent
module node.
Symbol _ZN2v86String9Utf8ValueC1ENS_5LocalINS_5ValueEEE (number 92) is not exported from dependent
module node.


Can someone help me sort this out?
Also, if anyone has any working examples, they wouldn't mind sharing, that would be greatly appreciated.

Thanks

Mike
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource.

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource.

NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource.

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at https://archive.midrange.com/opensource.

NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.