mapbox / mapbox/node-pre-gyp

Require('node-pre-gyp') give void object in sqlite3.js, node.js, Raspberry

Open
#429 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
271
Avg merge
23h 40m
Merged PRs (30d)
2

Description

**I have the next error in node.js with sqlite3 when trying to execute some js script:**
"
/usr/local/lib/node_modules/sqlite3/lib/sqlite3.js:4
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
^
TypeError: binary.find is not a function
"
**Checking more deeply, i found:**
"
// File /usr/local/lib/node_modules/sqlite3/lib/sqlite3.js
var binary = require('node-pre-gyp');
console.log(binary) ; // **I put this, and it displays: {}**
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))); // **And here is the error**

"
**In _/usr/local/lib/node_modules/sqlite3/node_modules/node-pre-gyp_, when using the command _testpackage_ (https://www.npmjs.com/package/node-pre-gyp), i got:**
"
root@openHABianPi:/usr/local/lib/node_modules/sqlite3/node_modules/node-pre-gyp# node-pre-gyp testpackage

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@10.13.0 | linux | arm
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: node-pre-gyp package.json is not node-pre-gyp ready:
node-pre-gyp ERR! stack package.json must declare these properties:
node-pre-gyp ERR! stack binary.module_name
node-pre-gyp ERR! stack binary.module_path
node-pre-gyp ERR! stack binary.host
node-pre-gyp ERR! stack at validate_config (/usr/local/lib/node_modules/node-pre-gyp/lib/util/versioning.js:220:15)
node-pre-gyp ERR! stack at Object.module.exports.evaluate (/usr/local/lib/node_modules/node-pre-gyp/lib/util/versioning.js:279:5)
node-pre-gyp ERR! stack at testpackage (/usr/local/lib/node_modules/node-pre-gyp/lib/testpackage.js:20:27)
node-pre-gyp ERR! stack at Object.self.commands.(anonymous function) [as testpackage] (/usr/local/lib/node_modules/node-pre-gyp/lib/node-pre-gyp.js:52:37)
node-pre-gyp ERR! stack at run (/usr/local/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:82:30)
node-pre-gyp ERR! stack at Object. (/usr/local/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:134:1)
node-pre-gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:688:30)
node-pre-gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
node-pre-gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:598:32)
node-pre-gyp ERR! stack at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
node-pre-gyp ERR! System Linux 4.14.70-v7+
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-pre-gyp" "testpackage"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/sqlite3/node_modules/node-pre-gyp
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/sqlite3.js and the reported require('node-pre-gyp') result, then inspect lib/util/versioning.js and lib/testpackage.js around the displayed validation stack. Reproduce the issue with Node.js 10 on Linux ARM and the testpackage command; done means the loading failure and testpackage behavior are explained and covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.