Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/error-message.js')
-rw-r--r--lib/utils/error-message.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/error-message.js b/lib/utils/error-message.js
index 12f304d1e..3faa78f30 100644
--- a/lib/utils/error-message.js
+++ b/lib/utils/error-message.js
@@ -35,9 +35,9 @@ function errorMessage (er) {
case 'EACCES':
case 'EPERM':
const isCachePath = typeof er.path === 'string' &&
- er.path.startsWith(npm.config.get('cache'))
+ npm.config && er.path.startsWith(npm.config.get('cache'))
const isCacheDest = typeof er.dest === 'string' &&
- er.dest.startsWith(npm.config.get('cache'))
+ npm.config && er.dest.startsWith(npm.config.get('cache'))
const isWindows = process.platform === 'win32'