mapbox / mapbox/node-pre-gyp

On windows npm install <dir> succeeds (no errors reported), but no .node file copied.

Open
#212 0 comments 0 reactions 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 am trying to add node-pre-gyp to bundle pre-compiled binaries and followed the instructions:
1. package.json additions:
"dependencies": {
"node-pre-gyp": "0.6.x",
"nan": "~2.3.0"
}
"binary": {
"module_name": "oracledb",
"module_path": "./build/Release",
"host": "http://10.242.85.120:7777/pv",
"remote_path": "",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz"
}

"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
2. binding.gyp additions:

{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ]
}

Steps followed:
node-pre-gyp clean
node-pre-gyp configure
node-pre-gyp build
node-pre-gyp package

and this creates a tar.gz file in build\stage directory.
1. Copied this tar.gz to a http location and it is accessible and is visible from a browser and wget command. (noticed node-pre-gyp\lib\util\versioning.js complains about the http protocol, and have hacked to skip this check).

On a clean directory running "npm install " seem to go through clean and pulls all dependencies under node_modules\ directory, but .node file is not there.

This is on the same machine and so generated tar.gz name will match the platform + node version etc.

The same steps on Linux, brings me the .node file, but on Windows .node file is not there.

Looking at the http log, while running the command on LInux, I can see the entry, but same command on windows does not show any entries in http log.

Any suggestions please?

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 package.json's install script and the binding.gyp action_after_build target, then compare Windows and Linux npm install behavior using the generated build\stage tar.gz and HTTP log. Done means Windows npm install retrieves the package and places the .node file under build\Release, matching Linux.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.