Discussion (13)2
Log in or sign up to continue

The instructions in the docs are different from the usual place a node.js module like iris.node should be put.

Usually, you create a test.js file in a directory of your choice, e.g. in C:\Test and inside this directory, you create a C:\Test\node_modules directory where iris.node should be placed.

When you do:

var iris = require('iris')

Your test.js file will look for it inside node_modules.

Did not work:

Error: Não foi possível encontrar o procedimento especificado.
\\?\C:\projetos\curso-react-native\tasks-backend\node_modules\iris.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Server.app.listen (C:\projetos\curso-react-native\tasks-backend\index.js:7:19)
    at Object.onceWrapper (events.js:273:13)
    at Server.emit (events.js:182:13)
    at emitListeningNT (net.js:1324:10)

A few more things to check: 

  • when you installed Node.js version 10.x, you need iris1000.node (for version 8.x, you need iris800.node)
  • you can ask for the most recent build via WRC
  • the IRIS architecture version (x86 or x64) must match the iris.node architecture version

If the module still refuses tot load, I'll upload an example test.js file I use myself to test basic functionality.

Btw, as the error occurs in the require() already, I still suspect there is a Node.js module version mismatch:

https://npm.community/t/node-module-version-confusion/2982

https://github.com/kelektiv/node.bcrypt.js/issues/635

You need to double check which Node.js version and iris.node version you have. I suspect there is a mismatching iris.node version somewhere on your machine that require() finds in the module search path.

internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Não foi possível encontrar o procedimento especificado.
\\?\c:\teste\node_modules\iris.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (c:\teste\iristest.js:1:74)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

This is a basic test script I'm using to test basic connectivity from Node.js v8.x, the iris.node module version included is meant for an IRIS x64 instance on Windows with Node.js v8.x x64 installed.

It contains everything you need, you can immediately run it - you should see the same results. The test script assumes IRIS is installed in C:\InterSystems\IRIS and the _SYSTEM user contains the default password. If not, you need to change this in the example script iristest.js in the db.open() parameters.

iris_node_connector_test.zip

IRIS Node.js connector test script

Btw, if you're developing a React Native app and you need a back-end server for IRIS, you can try the react-qewd module for Node.js for use with the QEWD.js back-end server for IRIS.