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

Homebrew Node on WSL not Adding .npm-global to $PATH #13657

Closed
jmssmth opened this issue Apr 26, 2019 · 1 comment
Closed

Homebrew Node on WSL not Adding .npm-global to $PATH #13657

jmssmth opened this issue Apr 26, 2019 · 1 comment

Comments

@jmssmth
Copy link

jmssmth commented Apr 26, 2019

Description
I'm finding that after installing node via Homebrew onto WSL, .npm-global isn't being added to $PATH. Maybe it's not supposed to, but given the tutorial instructions, this will be a stumbling block for those utilizing WSL and/or unfamiliar with such things. For now I'm simply adding .npm-global manually to the WSL $PATH as a fix.


Steps to reproduce
After installing gatsby-cli globally in WSL, which gatsby would return the path for gatsby from the Windows filesystem... (basically C:/Users/<USER>/AppData/Roaming/npm/gatsby). I have since deleted this instance as I no longer need it there. After confirming gatsby shows up in npm -g ls --depth=0, realized .npm-global was not added to $PATH.

Also too, part of this is the Microsoft decision to have WSL import the Windows OS Path vars on top of it's own. Thusly echo $PATH in WSL for me returns several /mnt/c/** paths.


Env Specs
- OS: WSL (Ubuntu 18.04) on Windows 10 Pro (build 17763)
- Homebrew: v2.1.1
- Node: v11.14.0 (brew)
- Gatsby: v2.5.12 (globally installed)
- Coffee: Enthiopian Yirgacheffe
- Location: West Texas
- Other: Gatsby Fanatic!

Gatsby Info

➤ /home/james/.npm-global/bin/gatsby info

  System:
    OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 11.14.0 - /home/linuxbrew/.linuxbrew/bin/node
    npm: 6.9.0 - /home/linuxbrew/.linuxbrew/bin/npm
  Languages:
    Python: 3.7.2 - /home/james/miniconda3/bin/python
  npmGlobalPackages:
    gatsby-cli: 2.5.12
@jmssmth
Copy link
Author

jmssmth commented Apr 30, 2019

Disregard this please. Not sure how my .npmrc was config'd to set the prefix to $HOME/.npm-global, but sure enough, that was the problem.

@jmssmth jmssmth closed this as completed Apr 30, 2019
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