7

こんにちは、LessCss コマンド ライン コンパイラを Mac にインストールしようとしています。

私はもう試した

brew install less
Error: No available formula for less

brew install lessc
Error: No available formula for lessc

sudo npm install -g less
..Installs happily..

sudo npm install -g lessc
npm http GET https://registry.npmjs.org/lessc
npm http 404 https://registry.npmjs.org/lessc
npm ERR! 404 'lessc' is not in the npm registry.

npm install less --global
..Installs happily..

npm install lessc --global
npm http GET https://registry.npmjs.org/lessc
npm http 404 https://registry.npmjs.org/lessc
npm ERR! 404 'lessc' is not in the npm registry.

そして私が得るのは

less js/less/style.less > style-theme.css
-bash: less: command not found

lessc js/less/style.less > style-theme.css
-bash: lessc: command not found

誰もこれについて経験がありますか?


パス変数が台無しになっている可能性があるという何かを見つけました。これ:

/bin/echo $PATH

私を取得します:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
4

3 に答える 3

8

私は完全な答えを提供しようとします。

すべてのコマンドは、ターミナルアプリケーションで実行する必要があります。

  1. お持ちでない場合: Xcode 用のコマンド ライン ツールをインストールします。

    xcode-select --install

  2. 持っていない場合: HomeBrew をインストールします。

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  3. お持ちでない場合: Node.js をインストールします。

    brew install node

  4. LessCSSをインストールする

    sudo npm install -g less

これでコマンドを実行できlesscます。

于 2014-11-24T13:20:53.307 に答える