lessc二进制在通过NPM安装少之后不可用 [英] lessc binary not available after installing less via NPM
问题描述
我继续安装并测试了node.js,然后我通过NPM安装了LESS CSS,但当我输入命令
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
或
lessc styles.less > styles.css
它告诉我 -bash:lessc:command not found
我在MAC Lion Terminal程序
I'm in MAC Lion Terminal program
strong>:
EDIT:
安装Node后需要运行此命令
After installing Node you need to run this command
ln -s ~/.npm/less/1.2.1/package/bin/lessc (path to directory you want)
b $ b
然后你将能够在该目录下的任何更少的文件上运行更少。
Then you will be able to run less on any of the less files in that directory.
它可以工作,但它不是编译导入到一个CSS文件。它只是在文件中保留导入。我希望我可以结合所有的CSS里面的文件,我导入在一起。
It works but it's not compiling the imports into one CSS file. It just leaves the imports in the file as is. I was hoping I could combine all of the CSS inside the files that I'm importing together.
推荐答案
当您通过npm安装LESS时,使用-g选项全局安装。
When you install LESS via npm use the -g option to install it globally.
npm install -g less
这篇关于lessc二进制在通过NPM安装少之后不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!