diff --git a/lib/pip.js b/lib/pip.js index cc13d073..5f8d5266 100644 --- a/lib/pip.js +++ b/lib/pip.js @@ -34,7 +34,8 @@ function installRequirements(requirementsPath, targetFolder, serverless, service let cmdOptions; let pipCmd = [ options.pythonBin, '-m', 'pip', '--isolated', 'install', - '-t', targetRequirementsFolder, '-r', dotSlsReqs, + '-t', dockerPathForWin(options, targetRequirementsFolder), + '-r', dockerPathForWin(options, dotSlsReqs), ...options.pipCmdExtraArgs, ]; if (!options.dockerizePip) { @@ -117,7 +118,19 @@ function installRequirements(requirementsPath, targetFolder, serverless, service }; /** - * create a filtered requirements.txt without anything from noDeploy + * convert path from Windows style to Linux style, if needed + * @param {Object} options + * @param {string} path + * @return {string} + */ +function dockerPathForWin(options, path) { + if (process.platform === 'win32' && options.dockerizePip) { + return path.replace('\\', '/'); + } + return path; +} + +/** create a filtered requirements.txt without anything from noDeploy * @param {string} source requirements * @param {string} target requirements where results are written * @param {Object} options