Closed Leccho closed 2 years ago
I'm getting this error when trying to connect to my database:
Error: spawn java ENOENT
Here's my code:
const Sybase: any = require('sybase'); const db: any = new Sybase('host', port, 'database', 'user', 'password'); db.connect(); // crashing here
Here's the librairy's code where the error is happening:
Sybase.prototype.connect = function(callback) { var that = this; console.log(this.pathToJavaBridge); // C:\...\node_modules\sybase\JavaSybaseLink\dist\JavaSybaseLink.jar this.javaDB = spawn('java',["-jar",this.pathToJavaBridge, this.host, this.port, this.dbname, this.username, this.password]); ... }
Doing the following command in C:\...\node_modules\sybase\JavaSybaseLink\dist\ will print connected to the console:
C:\...\node_modules\sybase\JavaSybaseLink\dist\
java -jar JavaSybaseLink.jar host port user password
So I'm confused as why it's not working...
Looks like since vscode was not running as administrator, he could not access the java command.
I'm getting this error when trying to connect to my database:
Here's my code:
Here's the librairy's code where the error is happening:
Doing the following command in
C:\...\node_modules\sybase\JavaSybaseLink\dist\
will print connected to the console:So I'm confused as why it's not working...