Skip to content

[Bug] Native dependencies fail to build if the project's path contains spaces #716

@ngryman

Description

@ngryman
  • I'd be willing to implement a fix

Describe the bug

Native dependencies fail to build if there is a space in the project's path. It's happening during the compilation phase of the dependency.

I've tracked down the error and it comes the fact we add a --require /path/to/.pnp.js in NODE_OPTIONS. The path gets truncated if it contains a space (cf. screenshot).

NODE_OPTIONS documentation mentions that options containing spaces should be escaped with a \. However when I tried to monkey patch to test if it works, it was still truncating the path. I'm not exactly sure why though...

Do you know where to properly patch the code for this, in order to test if adding a \ really works?

To Reproduce

await expect(packageJsonAndInstall({
  dependencies: {
    [`node-sass`]: `latest`
  }
})).resolves.toBeTruthy();

Screenshots

In the following path: /Users/ngryman/Projects/OSS/Code/berry spaces, here is the log of the build when running yarn add node-sass:

Environment if relevant (please complete the following information):

  • OS: Mac OS Catalina
  • Node version 10.17.0
  • Yarn version master branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreproducibleThis issue can be successfully reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions