From 42ddcd8a38e8ca71741c430b64de894d49b47d9f Mon Sep 17 00:00:00 2001 From: Xinyuan Wang <40495740+ChelesteWang@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:10:59 +0800 Subject: [PATCH] chore: update cnpm mirror --- README.md | 4 ++-- lib/util/versioning.js | 2 +- test/versioning.test.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fcb78124..9b2821d9 100644 --- a/README.md +++ b/README.md @@ -732,11 +732,11 @@ Using the `npm` config argument: `--{module_name}_binary_host_mirror` can downlo e.g.: Install [v8-profiler](https://www.npmjs.com/package/v8-profiler) from `npm`. ```bash -$ npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ +$ npm install v8-profiler --profiler_binary_host_mirror=https://registry.npmmirror.com/node-inspector/ ``` e.g.: Install [canvas-prebuilt](https://www.npmjs.com/package/canvas-prebuilt) from `npm`. ```bash -$ npm install canvas-prebuilt --canvas_prebuilt_binary_host_mirror=https://npm.taobao.org/mirrors/canvas-prebuilt/ +$ npm install canvas-prebuilt --canvas_prebuilt_binary_host_mirror=https://registry.npmmirror.com/canvas-prebuilt/ ``` diff --git a/lib/util/versioning.js b/lib/util/versioning.js index 4409d7c7..bc75777d 100644 --- a/lib/util/versioning.js +++ b/lib/util/versioning.js @@ -311,7 +311,7 @@ module.exports.evaluate = function(package_json, options, napi_build_version) { }; // support host mirror with npm config `--{module_name}_binary_host_mirror` // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25 - // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ + // > npm install v8-profiler --profiler_binary_host_mirror=https://registry.npmmirror.com/node-inspector/ const validModuleName = opts.module_name.replace('-', '_'); const host = process.env['npm_config_' + validModuleName + '_binary_host_mirror'] || package_json.binary.host; opts.host = fix_slashes(eval_template(host, opts)); diff --git a/test/versioning.test.js b/test/versioning.test.js index 8d98ff61..eb1a039b 100644 --- a/test/versioning.test.js +++ b/test/versioning.test.js @@ -104,9 +104,9 @@ test('should detect custom binary host from env', (t) => { } }; // mock npm_config_test_binary_host_mirror env - process.env.npm_config_test_binary_host_mirror = 'https://npm.taobao.org/mirrors/node-inspector/'; + process.env.npm_config_test_binary_host_mirror = 'https://registry.npmmirror.com/node-inspector/'; const opts = versioning.evaluate(mock_package_json, {}); - t.equal(opts.host, 'https://npm.taobao.org/mirrors/node-inspector/'); + t.equal(opts.host, 'https://registry.npmmirror.com/node-inspector/'); delete process.env.npm_config_test_binary_host_mirror; t.end(); }); @@ -242,9 +242,9 @@ test('should replace "-" with "_" in custom binary host', (t) => { } }; - process.env.npm_config_canvas_prebuilt_binary_host_mirror = 'https://npm.taobao.org/mirrors/node-canvas-prebuilt/'; + process.env.npm_config_canvas_prebuilt_binary_host_mirror = 'https://registry.npmmirror.com/node-canvas-prebuilt/'; const opts = versioning.evaluate(mock_package_json, {}); - t.equal(opts.host, 'https://npm.taobao.org/mirrors/node-canvas-prebuilt/'); + t.equal(opts.host, 'https://registry.npmmirror.com/node-canvas-prebuilt/'); delete process.env.npm_config_canvas_prebuilt_binary_host_mirror; t.end(); });