mapbox / mapbox/node-pre-gyp

solution canvas node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using needle for node-pre-gyp https download

Open
#526 4 comments 9 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

#439 #477 #525

If the print information is (如果打印信息是)

canvas@2.6.1 install  *\node_modules\canvas
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download

Please add when installing (安装时请添加)

--canvas_binary_host_mirror=https://npm.taobao.org/mirrors/node-canvas-prebuilt/

Full command (完整命令)

npm i --canvas_binary_host_mirror=https://npm.taobao.org/mirrors/node-canvas-prebuilt/

If you install canvas separately (如果是单独安装canvas)

npm i  canvas --canvas_binary_host_mirror=https://npm.taobao.org/mirrors/node-canvas-prebuilt/

reference (参考)
https://github.com/mapbox/node-pre-gyp#download-binary-files-from-a-mirror

Explanation:This is because canvas's package.json uses these configurations
(解释:这是因为 canvas 的 package.json 使用了这些配置)

  "binary": {
    "module_name": "canvas",
    "module_path": "build/Release",
    "host": "https://github.com/node-gfx/node-canvas-prebuilt/releases/download/",
    "remote_path": "v{version}",
    "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"
  },

In some areas, the download address of github is slow, so you can use the --{module_name}_binary_host_mirror command to change the download address to solve the problem that the download is very slow, causing stuck in node-pre-gyp WARN Using needle for node-pre-gyp https download problem.
For other package problems, you can find the corresponding mirror address to solve.
(某些地区github的下载地址比较慢,所以可以通过--{module_name}_binary_host_mirror命令来更换下载地址,解决下载很慢,导致卡在node-pre-gyp WARN Using needle for node-pre-gyp https download的问题。
其他包的问题,可以找一下对应的镜像地址来解决。)

Another method is to set up an npm proxy to speed up access to github.
(另一种方法是设置npm代理,加速访问github。)

npm config set proxy http://server:port
npm config set https-proxy http://server:port

delete agent (删除代理)

npm config delete proxy
npm config delete https-proxy

keywords: (关键词:)
node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using needle for node-pre-gyp https download

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 the issue's package.json binary configuration and the referenced node-pre-gyp mirror documentation. The issue describes a canvas download workaround but names no repository file, test, or specific documentation location; completion would require deciding where the workaround belongs and documenting or otherwise addressing the installation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
build-system, tooling
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.