Skip to content

Git Bash issues with CLI tools #390

@alumni

Description

@alumni

The setup for Git Bash (Windows) cannot run cli tools that are installed using npm install -g.

$ fnm env
export PATH="C:\\Users\\XXX\\AppData\\Local\\Temp\\fnm_multishell_15584_1612875966568":$PATH
export FNM_MULTISHELL_PATH="C:\\Users\\XXX\\AppData\\Local\\Temp\\fnm_multishell_15584_1612875966568"
...

Running node works:

node -v
v15.8.0

But bash is somehow confused about the actual path:

$ which node
/c/Users/XXX/Work/neo-backend/\Users\XXX\AppData\Local\Temp\fnm_multishell_17812_1612875949353/node

And if I use any cli tool installed with npm, I'll get this:

$ npm install -g yarn
added 1 package

$ yarn 
node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\Git\Users\XXX\AppData\Local\Temp\fnm_multishell_17812_1612875949353\node_modules\yarn\bin\yarn.js'

This can be fixed by making sure that the PATH env variable is using Git-Bash paths:

export PATH="/c/Users/XXX/AppData/Local/Temp/fnm_multishell_15584_1612875966568":$PATH

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions