Closed labkapapka closed 1 year ago
Hi, Please provide a running test case, that describes the problem. Also, is this a new test case or did you run it with earlier node-oracledb versions?
@labkapapka , It looks like the process which ran the test case used older node.js version ? Can you confirm if there are multiple node.js versions on your host and somehow Cypress tests points to older versions (<14.6) .. You can verify once by calling console.log(process.versions.node)
from Cypress tests before loading oracledb
module ? Can you also share the output of node example/version.js .
We use process.version
to detect the node version .
@labkapapka , It looks like the process which ran the test case used older node.js version ? Can you confirm if there are multiple node.js versions on your host and somehow Cypress tests points to older versions (<14.6) .. You can verify once by calling
console.log(process.versions.node)
from Cypress tests before loadingoracledb
module ? Can you also share the output ofnode example/version.js .
We useprocess.version
to detect the node version .
Hm, i get 'undefined' when try calling console.log(process.versions.node) from Cypress test before loading oracledb module. The output of `node example/version.js is Node.js v18.16.0
@labkapapka , It looks like the process which ran the test case used older node.js version ? Can you confirm if there are multiple node.js versions on your host and somehow Cypress tests points to older versions (<14.6) .. You can verify once by calling
console.log(process.versions.node)
from Cypress tests before loadingoracledb
module ? Can you also share the output ofnode example/version.js .
We useprocess.version
to detect the node version .Hm, i get 'undefined' when try calling console.log(process.versions.node) from Cypress test before loading oracledb module. The output of `node example/version.js is Node.js v18.16.0
You have imported process in the file like below , where you have called? It is part of node.js process module
const process = require('process');
Yes, but result the same.
Can you try console.log(process.version);
which we used inside driver (lib/oracledb.js) . It looks like inside Cypress tests, the same property process.version
got overwritten as standalone (examples/version.js) works fine ? Can you cross check ?. Does an explicit const process =
require('node:process'); ``help ?
I'm no shure that I can. I just start to write tests on JS + Cypress. Which code and where i should to run?
I'm no shure that I can. I just start to write tests on JS + Cypress. Which code and where i should to run? Could you help me?
Can you try
console.log(process.version);
which we used inside driver (lib/oracledb.js) . It looks like inside Cypress tests, the same propertyprocess.version
got overwritten as standalone (examples/version.js) works fine ? Can you cross check ?. Does an explicitconst process =
require('node:process'); ``help ?
//oracledb.js 'use strict';
const constants = require('./constants.js'); const nodbUtil = require('./util.js'); const errors = require('./errors.js'); const types = require('./types.js'); const impl = require('./impl'); const process = require('process'); const util = require('util');
I mean inside the Cypress test files, can you add this piece of code and let me know the result.
{
const process = require('node:process');
console.log(process.version);
}
I mean inside the Cypress test files, can you add this piece of code and let me know the result.
{ const process = require('node:process'); console.log(process.version); }
if i add this piece of code i get:
//test.cy.js describe('TOKINIZER 3DS', () => { const process = require('node:process'); console.log(process.version); // const process = require('process'); // console.log(process.versions.node); it('Ord.1, Tokinizer, LOOK UP, MC,', () => { // const process = require('process'); // console.log(process.versions.node); const oracledb = require('oracledb');
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;
async function run() {
const connection = await oracledb.getConnection ({
user : "admin",
password : "admin!",
connectString : "b0t.test.local:1521/tzw1pgttest.local"
});
const result = await connection.execute(
`SELECT *
FROM PTEMPDATA`,
// bind value for :id
);
console.log(result.rows);
await connection.close();
}
run(); }); });
I see your Cypress environment cant access node modules as it is . Your tests passed with previous versions like oracledb@5.5?
Personally I suggest you hack our driver code in lib/oracledb.js where we throw the version check error and do either or both of:
process.version
.PS Please use triple backquotes to mark your code blocks in GitHub issues.
I see your Cypress environment cant access node modules as it is . Your tests passed with previous versions like oracledb@5.5?
No, tests wasn't success when I use oracledb@5.5. I get the same Error, like this: "node-oracledb 5.x.x requires Node.js 8.x or later"
Give me, please, extended guide how to do this. Which code and where I need to write?
@labkapapka You might want to try what this user did to enable cypress to work with node-oracledb: https://github.com/oracle/node-oracledb/issues/1261#issuecomment-777880518
Based on the inputs from this issue, it seems cypress does not have a node version available in its spec files, so even trying to import/require oracledb causes immediate failure with the NJS-069 error
This is a duplicate of #1261. Hence closing this issue. Request the user to refer to issue #1261
Hi! I have problem with node-oracledb. When I launch my test-case in Cypress - I get error: NJS-069: node-oracledb 6.0.3 requires Node.js 14.6 or later. But my current version: oracledb@6.0.3 Node JS version v18.16.0
Cypress package version: 12.17.4 Cypress binary version: 12.17.4 Electron version: 21.0.0 Bundled Node version: 16.16.0 Could you help me solve the problem?
Is it an error or a hang or a crash?
What error(s) or behavior you are seeing?