2

I can't use lessc. I have installed npm and node, which are located in usr/local/bin. When I install less via "$ npm install -g less" it is creating a new folder in Users/User/ called "npm-global":

/Users/User/npm-global/bin/lessc -> /Users/User/npm-global/lib/node_modules/less/bin/lessc
[email protected] /Users/User/npm-global/lib/node_modules/less
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected])

And then I type lessc and get that "this command is not found". Please help me to solve this problem.

2
  • What operating system are you using?
    – ATC
    Sep 14, 2016 at 10:49
  • It is OS X 10.9.5
    – Beginner
    Sep 14, 2016 at 18:47

1 Answer 1

2

If this folder

/Users/User/npm-global/bin

is not already in your PATH, you can add it in your ~/.profile file, e.g., by adding a line

export PATH=$PATH:/Users/User/npm-global/bin

at the end of the file. Presumably

/Users/User/npm-global/bin

is meant to be

/Users/$USER/npm-global/bin

which would allow you to simplify it (since the shell is bash, which expands tilde):

export PATH=$PATH:~/npm-global/bin
3
  • Why use /Users/$USER rather than $HOME? Sep 14, 2016 at 20:14
  • I was writing so that OP could match the string against his/her example, pointing out that the User was likely not the actual name. Sep 14, 2016 at 20:16
  • Thank you very much! I knew that the problem was in the path, but I couldn't adjust it that easy. Thanks!
    – Beginner
    Sep 14, 2016 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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