0

I am facing some issue in the installation of truffle. I used the command

 sudo npm install -g truffle
 /Users/vikas/.nvm/versions/node/v9.11.2/bin/truffle ->
 /Users/vikas/.nvm/versions/node/v9.11.2/lib/node_modules/truffle/build/cli.bundled.js
 truffle@4.1.13 added 81 packages in 14.406

Successfully added the packages but when I run command truffle version

or any another truffle command it gives

 -bash: /usr/local/bin/truffle: No such file or directory.

I am using macOS please someone help me out.

1

Truffle executable is currently installed in /Users/vikas/.nvm/versions/node/v9.11.2/bin/truffle. For some system or npm reason I ignore, this executable isn't accessible from the PATH

You can either:

- add a symlink to your /usr/local/bin/

$ sudo ln -sf /Users/vikas/.nvm/versions/node/v9.11.2/bin/truffle /usr/local/bin/

- add /Users/vikas/.nvm/versions/node/v9.11.2/bin/ to your path

Edit ~/.bash_profile. There will be a line that says something like PATH=$PATH:$HOME/bin.

Add :/Users/vikas/.nvm/versions/node/v9.11.2/bin/ to the end (be sure you have the colon)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.