From c55481f78e3c8ba4760934dd5f28229297fa768d Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Wed, 3 Apr 2019 23:12:03 +0300 Subject: [PATCH] fix(npm): check string before comparing Closes #3479 --- lib/manager/npm/post-update/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/manager/npm/post-update/index.js b/lib/manager/npm/post-update/index.js index 840cc5e3dc..62a4bda309 100644 --- a/lib/manager/npm/post-update/index.js +++ b/lib/manager/npm/post-update/index.js @@ -2,6 +2,7 @@ const fs = require('fs-extra'); const path = require('path'); const upath = require('upath'); const os = require('os'); +const is = require('@sindresorhus/is'); const npm = require('./npm'); const lerna = require('./lerna'); @@ -266,7 +267,7 @@ function listLocalLibs(dependencies) { const toCopy = []; if (dependencies) { for (const [libName, libVersion] of Object.entries(dependencies)) { - if (libVersion.startsWith('file:')) { + if (is.string(libVersion) && libVersion.startsWith('file:')) { if (libVersion.endsWith('.tgz')) { logger.info( `Link to local lib "${libName}": "${libVersion}" is not supported. Please do it like: 'file:/path/to/folder'` -- GitLab