mapbox / mapbox/node-pre-gyp

Arguments like --dist-url/--nodedir not respected with npm 3.10.10

Open
#300 3 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

## Context

When someone runs `npm install --some-option` to install a module that uses `node-pre-gyp`, then `node-pre-gyp` notices the arguments passed and forwards to `node-gyp` (when a source compile is needed). The same thing is done when `node-pre-gyp` is called directly (rather than via npm). This argument forwarding is critical to be able to control `node-gyp` behavior directly (since modules that use `node-pre-gyp` don't directly call `node-gyp`, by design).

## Problem

This argument passing works in all cases when arguments are passed directly to `node-pre-gyp`. For example `node-pre-gyp build --dist-url=foo` will result in a call to `node-gyp build --dist-url=foo`.

And this argument passing works in all cases when arguments are passed to `npm` and `npm calls` `node-pre-gyp` except on windows with npm 3.10.10. What I've seen is:

| | mac | linux | windows |
|-------------|--------------------|-------|---------|
| node v6/npm 3.10.10 | :white_check_mark: | :white_check_mark: | :x: |
| node v6/npm 2.15.11 (downgraded) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| node v4/npm 2.15.11 |:white_check_mark: | :white_check_mark: | :white_check_mark: |
| node v0.10/npm2.15.1 |:white_check_mark: | :white_check_mark: | :white_check_mark: |

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 by reproducing the issue on Windows with Node 6/npm 3.10.10, comparing npm-invoked node-pre-gyp with direct node-pre-gyp and the older npm versions listed in the table. Trace how --dist-url and --nodedir are forwarded to node-gyp; done means both arguments survive the npm invocation on Windows. The issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
build-system, 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.