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

Wrong paths with homebrew formula node@12 #17

Open
matz3 opened this issue Sep 22, 2020 · 0 comments
Open

Wrong paths with homebrew formula node@12 #17

matz3 opened this issue Sep 22, 2020 · 0 comments

Comments

@matz3
Copy link

matz3 commented Sep 22, 2020

Detected via https://github.com/SAP/ui5-cli/issues/374

This breaks the is-installed-globally module, which is used within update-notifier.

It can be reproduced within docker but also on WSL Ubuntu 18.04, so it seems to be a common problem with the node@12 formula.

Global packages are installed into /home/linuxbrew/.linuxbrew/lib/node_modules but npm.packages points to /home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4/lib/node_modules (where npm is installed).

I'm not sure whether this can/should be solved in this module or within the homebrew formula for node@12.

node@12 ❌

FROM homebrew/brew:2.4.11
USER linuxbrew
RUN brew install node@12
ENV PATH=/home/linuxbrew/.linuxbrew/opt/node@12/bin:$PATH
RUN npm i -g global-dirs
RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
Step 6/6 : RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
 ---> Running in 3041eed7dba6
{
  npm: {
    prefix: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4',
    packages: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4/lib/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4/bin'
  },
  yarn: {
    prefix: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4',
    packages: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4/global/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/Cellar/node@12/12.18.4/global/node_modules/.bin'
  }
}

node@14 ✅

FROM homebrew/brew:2.4.11
USER linuxbrew
RUN brew install node@14
RUN npm i -g global-dirs
RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
Step 5/5 : RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
 ---> Running in f93fd0092011
{
  npm: {
    prefix: '/home/linuxbrew/.linuxbrew',
    packages: '/home/linuxbrew/.linuxbrew/lib/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/bin'
  },
  yarn: {
    prefix: '/home/linuxbrew/.linuxbrew',
    packages: '/home/linuxbrew/.linuxbrew/global/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/global/node_modules/.bin'
  }
}

node ✅

FROM homebrew/brew:2.4.11
USER linuxbrew
RUN brew install node
RUN npm i -g global-dirs
RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
Step 5/5 : RUN node -e "console.log(require('/home/linuxbrew/.linuxbrew/lib/node_modules/global-dirs'))"
 ---> Running in 40b41954c0c4
{
  npm: {
    prefix: '/home/linuxbrew/.linuxbrew',
    packages: '/home/linuxbrew/.linuxbrew/lib/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/bin'
  },
  yarn: {
    prefix: '/home/linuxbrew/.linuxbrew',
    packages: '/home/linuxbrew/.linuxbrew/global/node_modules',
    binaries: '/home/linuxbrew/.linuxbrew/global/node_modules/.bin'
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant