Deivitto / auditor-docker

https://hackmd.io/7zriwLB0SD6-3AUDv3pBBg?view
GNU General Public License v3.0
123 stars 11 forks source link

`yarn` is not recognized as a command #31

Closed Deivitto closed 1 year ago

Deivitto commented 1 year ago

Yarn is installed in ~/.yarn, however, even if the path is declared at .bashrc, there is another line that I don't know yet why, it is overriding it. The line is line 125 in .basrhc after a clean installation:

- export PATH=":/home/whitehat/.nvm/versions/node/v18.17.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/whitehat/.local/bin"
+ export PATH="$PATH:/home/whitehat/.nvm/versions/node/v18.17.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/whitehat/.local/bin"

As can be notice, it is not appending $PATH variable, what actually fixes it into a regular installation. Need to further investigate. Meanwhile, the hotfix is just to append yarn after that line:

# Dockerfile#L166
# Append the specified PATH to .bashrc 
RUN echo 'export PATH="$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin"' >> ~/.bashrc
Deivitto commented 1 year ago

hotfixed at https://github.com/Deivitto/auditor-docker/commit/c9af46db7dc6506f06955c69bd08738b796cb37b