lessc binary not available after installing less via NPM

前端 未结 2 2003
离开以前
离开以前 2020-12-13 17:53

I went ahead and installed and tested node.js and then I installed LESS CSS via NPM but when I type in the command

lessc styles.less

or

相关标签:
2条回答
  • 2020-12-13 18:31

    When you install LESS via npm use the -g option to install it globally.

    npm install -g less

    0 讨论(0)
  • 2020-12-13 18:36

    When installing packages with npm you have two options:

    1. Install them globally: npm install -g <package>
    2. Install locally in your home directory under ~/.npm: npm install <package>

    If you choose option 1 your system should be able to locate the binary lessc. If you choose option 2 you should add ~/.npm/less/path_to_bin_directory to your path:

    export PATH=~/.npm/less/path_to_bin_directory:$PATH
    

    or better, if a ~/node_modules directory has been created as a result of installation:

    export PATH=~/node_modules/less/path_to_bin_directory:$PATH
    
    0 讨论(0)
提交回复
热议问题