Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Failed to load requirements.txt on Windows with dockerizePip set to false #252

@PatrickBuTaxdoo

Description

@PatrickBuTaxdoo

The sls deploy command fails if dockerizePip is set to false while using a windows system:

Could not open requirements file: [Errno 22] Invalid argument: 'C\\:\\\\Users\\\\[...]\\\\.serverless\\\\requirements\\\\requirements.txt'

There are way too many slashes. I think the error originates from this function in lib/pip.js:

function dockerPathForWin(options, path) {
  if (process.platform === 'win32' && options.dockerizePip) {
    return path.replace(/\\/g, '/');
  }
  return quote_single(path);
}

It should instead look like this:

function dockerPathForWin(options, path) {
  if (process.platform === 'win32') {
    return path.replace(/\\/g, '/');
  }
  return quote_single(path);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions