2

I am trying to install Less and Less-watch-compiler with Yarn. But I get a command not found when I check the lessc version.

I have OSX 10.11.6 El Capitan I installed Yarn using Homebrew. I have Yarn version 1.9.4. Then I used:

yarn global add less

This resulted in:

yarn global v1.9.4
[1/4]   Resolving packages...
[2/4]   Fetching packages...
warning Pattern ["less@^3.8.1"] is trying to unpack in the same destination "/Users/jem/Library/Caches/Yarn/v2/npm-less-3.8.1-f31758598ef5a1930dd4caefa9e4340641e71e1d" as pattern ["less@^3.0.4"]. This could result in non-deterministic behavior, skipping.
[----------------------------------------------------------------------------] 0/83(node:1407) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[3/4]   Linking dependencies...
[4/4]   Building fresh packages...
success Installed "less@3.8.1" with binaries:
      - lessc
✨  Done in 1.51s.

Then I used Yarn to get less-watch-compiler. Using the command: yarn global add less-watch-compiler

That resulted in:

yarn global v1.9.4
[1/4]   Resolving packages...
[2/4]   Fetching packages...
[-----------------------------------------------------------------------------------] 0/83(node:1597) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[3/4]   Linking dependencies...
[4/4]   Building fresh packages...
success Installed "less-watch-compiler@1.11.3" with binaries:
      - less-watch-compiler
✨  Done in 1.27s.

After doing this I checked the version of less by typing lessc —version. The result is:

-bash: lessc: command not found

In my ~/Library/Caches/Yarn/v2 directory I can see:

npm-less-3.8.1-f31758598ef5a1930dd4caefa9e4340641e71e1d
npm-less-watch-compiler-1.11.3-eb1fc62423898fae48fde1bed4968bb81bf220f2

I’m not sure if this means that Less was installed.

I saw this question: lessc: command not found It says I should Export the location of lessc into the PATH. But I need to know where lessc is? But I’m not sure if the above items in the Cache file are the ones I need. I’ve tried removing node, yarn and nvm from my machine. I’ve removed and reinstalled yarn. But I get the same results each time.

Also, on my machine is another program called less. It's a unix page reader. http://www.greenwoodsoftware.com/less/ This has made things confusing.

I’m new to this, and I’ve reached a dead end. Any help is appreciated.

Edit: I also tried to install yarn with npm.

 sudo npm i -g yarn
 sudo npm i -g less
 sudo npm i -g less-watch-compiler

That didn't work either. Also, when I look for lessc or less-watch-compiler using

$ which lessc

I don't get a response.

tk421
  • 5,775
  • 6
  • 23
  • 34
ruby n max
  • 87
  • 2
  • 12

0 Answers0