yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

--modules-folder breakers install (cannot find binaries) #8902

Open james-lawrence opened 2 years ago

james-lawrence commented 2 years ago

steps to reproduce

yarn add --dev canvas
# this will work
yarn install 
# this will fail
yarn --modules-folder cached/node_modules install
yarn install v1.22.19
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error {HOME}/app/test/cached/node_modules/canvas: Command failed.
Exit code: 127
Command: node-pre-gyp install --fallback-to-build --update-binary
Arguments: 
Directory:  {HOME}/app/test/cached/node_modules/canvas
Output:
/bin/sh: line 1: node-pre-gyp: command not found
james-lawrence commented 2 years ago

manually setting the environments PATH resolves the issue; but that shouldn't be necessary.

mhaley37 commented 1 year ago

Could you elaborate on your workaround @james-lawrence ? I've recently run into the same issue. Thanks.

james-lawrence commented 1 year ago

sure. not the exact command we're running but these are all the values we needed to adjust.

BUILD_PATH={dir} PATH=${PATH}:{dir}/node_modules/.bin yarn --modules-folder ${dir}/console/node_modules --cache-folder {dir}/console/cached --cwd ${dir}/console build