Hello so I have started to Atlassian Forge yesterday but I already have a problem. I just got a new MacBook and I’m trying to get use to this device. While I was using the terminal I had a problem and decided to reopen the terminal. When I reopened the app node, nvm, npm and forge commands were not being accepted and I got the following sentence:zsh: command not found: forge
. I have been looking through everywhere and I couldn’t find any solutions.
@Bekirmeriek, perhaps you were in a different shell other than zsh
or maybe your environment scripts/configs aren’t loading properly. So, try re-running zsh
or bash
from your terminal to see if the paths get set properly.
I’m also on a Mac, and sometimes I find myself in same situation, and I have to run bash
in order for environment to get in their right place.
@nmansilla , thank you for your response. I have tried to use it also in bash too but sadly no hope. I am currently planning to re-install everything all over again.
Hopefully, you’re well on your way to productivity again. But I was inspired by your case of getting a new laptop, and decided to share some of my developer workstation tips:
I’ve experienced the same issue and can’t fix it.
Have you fixed it somehow?
- Install Forge CLI
Make sure you have the Forge CLI installed. You can install it using npm (Node Package Manager) by running the following command in your terminal:
npm install -g @forge/cli
- Update your PATH:
Ensure that the directory where npm installs global packages is included in your system’s PATH. The global npm package directory is usually something like~/.npm-global/bin
. Add the following line to your shell configuration file (e.g.,~/.zshrc
for Zsh):
export PATH="$PATH:$HOME/.npm-global/bin"
Save the file and restart your terminal or run source ~/.zshrc
to apply the changes
- Verify installation:
After updating your PATH, verify that Forge CLI is now accessible by running:
forge --version
This should display the version of the Forge CLI, confirming that it is now in your PATH.
Welcome to the Atlassian developer community @ByteBlendApps,
I am surprised that Node’s native installation didn’t handle the path management. How odd!
I would point out that step 2 is one possible work-around but not necessarily the best solution in all cases. It is common to use a Node version manager, like nvm
or fnm
(as I wrote about in the blog I posted above). In that case, the global packages location is different for different versions of node. Fortunately, the version manager should handle the path management itself.
In any case, I readily admit that our documentation does not address all the nuances of shell management or Node.js management, but simply recommends nvm
. I’m glad you were able to discover and provide some additional insights here. Thanks for posting a self-solution to your problem so quickly!