“Please try running this command again as Root/Administrator” error when trying to install LESS

后端 未结 11 2066
栀梦
栀梦 2020-12-02 14:09

I\'m trying to install LESS on my machine and have installed node already. However, when I enter \"node install -g less\" I get the following error and am not sure what to d

11条回答
  •  心在旅途
    2020-12-02 14:41

    This is what I had to do to get started with a Less compiler to avoid issues as mentionned in the OP:

    1. Install node.js
    2. Install NPM with Terminal: sudo npm install npm -g
    3. Install a Less compiler with Terminal: sudo npm install -g less (the sudo makes all the difference)
    4. If you're using PHPstorm: Go to "Preferences… > Plugins" and install NodeJS-plugin (might need to "browse repositories" to find it) and restart PHPstorm (as prompted)
    5. After that go to Plugins once again: Install Less compiler (might need to "browse repositories" to find it) and restart PHPstorm (as prompted)
    6. Once you have a project set up, go to "Settings > Tools > Filewatchers" and add "Less". The path (of the "Program") should read something like this: /usr/local/bin/lessc
    7. Make sure Track only root files is checked in the settings of 6.

提交回复
热议问题