joeferner / node-java

Bridge API to connect with existing Java APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latest, 0.14, package on npmjs.org isn't 0.14

puzzle-it-nu opened this issue · comments

It looks like the code that is on npmjs.org for version tab v0.14.0 isn't what is here on github.
Running npm install java --ignore-scripts and checking the find_java_libdir.sh shows that its missing a crucial ^ character which causes problems when you have openjdk-17 installed. Line 26 is missing the caret character.
Forcing the v0.14.0 version from github in my package.json and using overrides : { "java": "$java" } } makes npm install work.

I see a lot of issues that might have this at the core of its problem.

For completeness my package.json

{
  "name": "jdbctest",
  "version": "1.0.0",
  "description": "",
  "exports": "./test-jdbc.js",
  "engines": {
    "node": ">=16"
  },
  "type": "module",
  "module": "es2022",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "ts-node test-jdbc.ts"
  },
  "keywords": [],
  "author": "Me",
  "license": "ISC",
  "dependencies": {
    "@types/node": "^20.11.21",
    "java": "github:joeferner/node-java#v0.14.0",
    "node-jdbc-driver": "^1.3.2",
    "nodejs-jdbc": "^0.1.4"
  },
  "devDependencies": {
    "ts-node": "^10.9.2",
    "typescript": "^5.3.3"
  },
  "overrides": {
    "java": "$java"
  }
}

Both node-jdbc-driver and nodejs-jdbc use node-java but the latter uses 0.14 and the former 0.12.1 from npmjs.org and both have problems being compiled by node-gyp.

With the above it compiles/installs with node-20