Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install script in scoped package referencing linked workspace package fails on Windows #6920

Open
artursgirons opened this issue Jan 14, 2019 · 1 comment
Assignees
Labels

Comments

@artursgirons
Copy link

artursgirons commented Jan 14, 2019

Bug report

  • yarn 1.13.0
  • Node 10.15.0
  • Windows 10 1809 (BUG)
  • macOS Mojave 10.14.2 (SUCCESS)

Workspace definition:

  "workspaces": {
    "packages": [
      "platforms/*/packages/*",
      "platforms/*",
      "projects/*",
      "templates/template-project"
    ]
  }

Install script in packages:

  "scripts": {
    "install": "frontful-tools install",
  },

When I have a scoped @template/platform package in platforms/* that calls postinstall install script that is linked in workspace, and I do yarn install I get an error:

Cannot find module 'C:\workspace\node_modules\node_modules\frontful-tools\bin\frontful-tools.js'

NOTICE: \node_modules\node_modules\

When this package (frontful-tools) is present in any of @template\platform's packages/* I get simmilar but different error:

Cannot find module 'C:\workspace\node_modules\@template\platform\packages\frontful-tools\bin\frontful-tools.js'

NOTICE: \node_modules\@template\platform\packages\

All of these things work on macOS as expected, no errors, all scripts get launched as expected.

Simple steps to reproduce on Windows:

  • git clone https://github.com/frontful/frontful-workspace
  • copy templates/template-platform to platforms/template-platform
  • yarn install

If I remove @template/platform scope all works as expected.

@ghost ghost assigned kaylie-alexa Jan 14, 2019
@ghost ghost added the triaged label Jan 14, 2019
@artursgirons
Copy link
Author

artursgirons commented Jan 14, 2019

What I ended up doing is to remove the scope from intermediate projects (those in platforms/* workspace definition above) as those projects won't be published anyway they are just monorepos with some utilities to manage all the packages in platforms/*/packages/*. But still, it would be nice if when scoped install script won't cause the error on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants