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

--modules-folder leads to broken npm install script execution #5200

Open
ingobecker opened this issue Jan 9, 2018 · 2 comments
Open

--modules-folder leads to broken npm install script execution #5200

ingobecker opened this issue Jan 9, 2018 · 2 comments
Assignees
Labels

Comments

@ingobecker
Copy link

I'm unsure if this issue is related to yarn or the way the 'node-sass' package is written. I tried to run yarn install --modules-folder <some_folder> to install a package which depends on a package that tries to call node to run a npm installation script. While this works without using --modules-folder it fails while using it, as the npm install script relies on another package which can't be found at the runtime of this script as it is a dependency of this dependency installed into the custom modules folder. Invoking yarn by setting the NODE_PATH manually to the path specified by --modules-folder makes the installation script run flawlessly (NODE_PATH=<custom_path> yarn install --modules-folder <custom_path>).
I don't know if it's just bad practice of the node-sass package to rely on a packages dependency in a install script or if there is something wrong with the way yarn handles the --modules-folder option.

Following versions are used:

  • yarn 1.3.2
  • node v8.9.4
  • debian 9.3
@ghost ghost assigned arcanis Jan 9, 2018
@ghost ghost added the triaged label Jan 9, 2018
@witrin
Copy link

witrin commented Feb 4, 2018

I would say node-sass package is fine. Same problem here. With an option like --modules-folder <folder> I would expect that yarn run [...] prepares the environment with <folder> so resolving packages using require just work but it does not.

@witrin
Copy link

witrin commented Feb 4, 2018

@ingobecker But there might be a simple workaround for you. Just put the following in your .yarnrc:

--*.modules-folder <folder>
env:
  NODE_PATH "<folder>"

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

3 participants