The problem of environment variables under nodubuntu? No command found?

  node.js, question

After many node packages are installed, the execution always says that the command cannot be found. And I have installed it globally
The solution I found online looks like this
Execute firstnpm bin -gThe results are as follows

/home/××××/node/bin
 (not in PATH env variable)

Then execute the following command
export PATH=$PATH:/home/××××/node/bin

This can be solved, but every time you install a new package, you have to perform this, which feels very troublesome, and there is no good way to modify the global bin? What is the cause of this, please find out

export PATH=$PATH:/home/××××/node/bin

Add this sentence to. bashrc (or other shell)