I have install: npm install -g truffle
Node version: v10.20.1
NPM version: 6.14.4 After installing npm install -g truffle, it gets install successfully, but when I checked
truffle version
it shows me ,command not found truffle
I have install: npm install -g truffle
Node version: v10.20.1
NPM version: 6.14.4 After installing npm install -g truffle, it gets install successfully, but when I checked
truffle version
it shows me ,command not found truffle
Try running truffle version
in the same console you did the npm install -g truffle
If it works on that terminal but not in new ones it means that the npm is not configured to be persistent across your sessions.
Here is an example of how to enable npm in other sessions.
I had a similar issue. When I check the logs of npm install, I noticed these lines:
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
If you also have this kind of an error, that might be the reason.
I applied this:
sudo chown -R $USER /usr/local/lib/node_modules
and here is why: https://flaviocopes.com/npm-fix-missing-write-access-error/
After giving access to node_modules, I installed truffle again (this time it took much longer btw)
it worked for me, I hope it helps.