Reon90 / glfwJS

The N-API bindings for GLFW
MIT License
49 stars 6 forks source link

Local builds are placed in wrong directory #7

Open joepie91 opened 2 years ago

joepie91 commented 2 years ago

On Linux, the npm package contains a Linux build in...

build/linux/Release/glfwJS.node

... however, when building the package locally on post-install, the build ends up in...

build/Release/glfwJS.node

... and the other contents of the build folder seem to get wiped out. This produces the following error when attempting to use glfwJS:

[nix-shell:~/projects/ui-experiment]$ node example.js 
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '../build/linux/Release/glfwJS.node'
Require stack:
- /home/sven/projects/ui-experiment/node_modules/glfw-n-api/generated/interface.js
- /home/sven/projects/ui-experiment/node_modules/glfw-n-api/index.js
- /home/sven/projects/ui-experiment/example.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/sven/projects/ui-experiment/node_modules/glfw-n-api/generated/interface.js:2:14)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/sven/projects/ui-experiment/node_modules/glfw-n-api/generated/interface.js',
    '/home/sven/projects/ui-experiment/node_modules/glfw-n-api/index.js',
    '/home/sven/projects/ui-experiment/example.js'
  ]
}

(Note that I cannot use the build included in the npm package for using-a-weird-distro reasons, but presumably this affects any case where the build gets carried out locally for any reason)