From 05869874412ef3841b65bdcba934b94f7c510e56 Mon Sep 17 00:00:00 2001 From: Donnie West Date: Sat, 2 Sep 2017 10:10:29 -0500 Subject: [PATCH] Prevent cross device linking error by copying instead of linking (#789) --- src/serverless/builders/nodejs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/serverless/builders/nodejs.js b/src/serverless/builders/nodejs.js index b4affc1..bdf4aa6 100644 --- a/src/serverless/builders/nodejs.js +++ b/src/serverless/builders/nodejs.js @@ -4,7 +4,7 @@ const { join } = require('path') const { exec } = require('child-process-promise') // Packages -const { mkdir, stat, link, existsSync, readdir } = require('fs-extra') +const { mkdir, stat, copy, existsSync, readdir } = require('fs-extra') const uid = require('uid-promise') const { toBuffer } = require('convert-stream') const archiver = require('archiver') @@ -23,8 +23,8 @@ const nodejsBuilder = async (dir, desc, { overrides = {} } = {}) => { files .filter(name => name !== 'node_modules' && !(name in overrides)) .map(file => { - debug('making hard link for %s', file) - return link(join(dir, file), join(targetPath, file)) + debug('making copy for %s', file) + return copy(join(dir, file), join(targetPath, file)) }) )