diff --git a/tools/npm/copy-npm-shrinkwrap b/tools/npm/copy-npm-shrinkwrap index 65d915bb9d..cbc722c199 100755 --- a/tools/npm/copy-npm-shrinkwrap +++ b/tools/npm/copy-npm-shrinkwrap @@ -1,5 +1,6 @@ #!/usr/bin/env node +var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); @@ -9,4 +10,8 @@ var PROJECT_ROOT = path.join(__dirname, '../../'); process.chdir(PROJECT_ROOT); -fse.copySync(NPM_SHRINKWRAP_FILE, NPM_SHRINKWRAP_CACHED_FILE); +if (fs.existsSync(NPM_SHRINKWRAP_FILE)) { + fse.copySync(NPM_SHRINKWRAP_FILE, NPM_SHRINKWRAP_CACHED_FILE); +} else { + console.warn(`${NPM_SHRINKWRAP_FILE} not found. Copy operation will be skipped.`); +}