From 4f801d8a476f7ca52b0f182bf4e17a80db12b4e2 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Wed, 25 Jul 2018 21:15:24 -0700 Subject: [PATCH 1/4] doc: file-specifier: Remove stray comment --- doc/spec/file-specifiers.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/spec/file-specifiers.md b/doc/spec/file-specifiers.md index 226f6d0136728..e8d992d86db31 100644 --- a/doc/spec/file-specifiers.md +++ b/doc/spec/file-specifiers.md @@ -55,9 +55,6 @@ note for the `npm-shrinkwrap.json` as it means the specifier there will be different then the original `package.json` (where it was relative to that `package.json`). -# No, for `file:` type specifiers, we SHOULD shrinkwrap. Other symlinks we -# should not. Other symlinks w/o the link spec should be an error. - When shrinkwrapping file specifiers, the contents of the destination package's `node_modules` WILL NOT be included in the shrinkwrap. If you want to lock down the destination package's `node_modules` you should create a shrinkwrap for it From 6944308298729403ddb5f13ae2b232e0ce3a85df Mon Sep 17 00:00:00 2001 From: Valentin Ouvrard Date: Tue, 31 Jul 2018 10:08:03 +1100 Subject: [PATCH 2/4] Fix IPv6 issue , https://npm.community/t/npm-work-only-in-old-ipv4-world/986/ --- lib/config/defaults.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 46eb6ca5116bf..4794ed1598783 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -387,12 +387,9 @@ function getLocalAddresses () { } return Object.keys(interfaces).map(function (nic) { - return interfaces[nic].filter(function (addr) { - return addr.family === 'IPv4' + .map(function (addr) { + return addr.address }) - .map(function (addr) { - return addr.address - }) }).reduce(function (curr, next) { return curr.concat(next) }, []).concat(undefined) From dfeab20774539110f1591e9b9a3d8de3ef8df8c0 Mon Sep 17 00:00:00 2001 From: Valentin Ouvrard Date: Tue, 31 Jul 2018 11:35:27 +1100 Subject: [PATCH 3/4] fix build ? --- lib/config/defaults.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 4794ed1598783..08f3b2c0b961b 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -385,11 +385,13 @@ function getLocalAddresses () { } catch (e) { interfaces = {} } - + return Object.keys(interfaces).map(function (nic) { - .map(function (addr) { - return addr.address + return interfaces[nic].filter(function (addr) { }) + .map(function (addr) { + return addr.address + }) }).reduce(function (curr, next) { return curr.concat(next) }, []).concat(undefined) From ec0d083702b83ef10353f19fa450607af5bf8c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Wed, 1 Aug 2018 17:51:26 -0700 Subject: [PATCH 4/4] cleanup --- lib/config/defaults.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 08f3b2c0b961b..826f72ab58b48 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -305,8 +305,6 @@ exports.types = { key: [null, String], 'legacy-bundling': Boolean, link: Boolean, - // local-address must be listed as an IP for a local network interface - // must be IPv4 due to node bug 'local-address': getLocalAddresses(), loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'], logstream: Stream, @@ -385,16 +383,10 @@ function getLocalAddresses () { } catch (e) { interfaces = {} } - - return Object.keys(interfaces).map(function (nic) { - return interfaces[nic].filter(function (addr) { - }) - .map(function (addr) { - return addr.address - }) - }).reduce(function (curr, next) { - return curr.concat(next) - }, []).concat(undefined) + + return Object.keys(interfaces).map( + nic => interfaces[nic].map(({address}) => address) + ).reduce((curr, next) => curr.concat(next), []).concat(undefined) } exports.shorthands = {