Im using Ubuntu 13.04 (Linux)
I have installed node, and npm. With npm I downloaded less via terminal.
Im using this on my simple HTML/CSS project. pure frontend. its not a Ruby or nodejs project.
And when I do
lessc styles.less styles.css -x -w
in terminal, it compiles and compresses the code, but doesn't watch the file for changes, since Im expecting LESS to auto compile and refresh the page automatically. So, if I do any changes in my styles.less, every-time I have to go to terminal and enter the command to compile the less css.
Also, the compiler does NOT even show any compile errors even if I add anything on purpose, but in that case it doesn't compiles.
Please guide me on how to achieve the above. This is my first day with LESS CSS.
If you type lessc help you will see that there is no argument -w or --watch. What you can do is to use a build system like GruntJS with an extension like grunt-contrib-watch and have that monitor your less files and build the css on change.
I did this with help of #Oil on ubuntu forums.
In terminal,
1. install sudo apt-get install inotify-tools
then simply CD to the css folder.
and run below lines together:
while inotifywait -r styles.less; do
lessc -x styles.less styles.css;
done
Related
i am learning tailwind css and in tutorial they write a command like this npx tailwindcss-cli build css/tailwind.css -o build/tailwind.css
and it build a different folder name "tailwind.css" in same directory
but in my case it gives a error
No valid exports main found for 'C:\Users\HHH\AppData\Roaming\npm-cache\_npx\4952\node_modules\tailwindcss-cli\node_modules\postcss'
I don't have any idea what it means and whats wrong with the setup.
please help.
I find the solution.
Just install the current node.js and reinstall the specific version.
download here
After that install it and everything works fine.
Note: It works in when you follow the tailwindcss cli method.
follow first part of video
I have a Grunt setup on my machine that's running SASS, Compass, Watch, Uglify... that kind of stuff. I've installed it using the command line (npm install...) from a tutorial.
I want to create a Grunt folder for another project. Is it okay to just copy that first folder and change the names? Is there some reason I should install the new one from the command line as well?
it will depends on what context you installed if was local or globally (-g).
If you installed locally without -g option, you are find to copy and past the folders.
However, would be a great practice to reuse only the package.json file and run the command, for your next project:
$ npm install
I have installed WebStorm 9 on Mac. I am having problems getting my LESS code compiled to CSS even after installing the LESS Compiler plugin.
The following message gets displayed:
"Missing CSS Output Directory - You can add CSS output directories under Settings > Project Settings > LESS Compiler"
Though there is no "Project Settings", I have add out put directory to LESS Compiler in "Settings".
It still does not work.
Known issue - see https://github.com/acdvorak/intellij-lessc-plugin/issues/47.
I can suggest using less compiler (npm install -g less) configured as a file watcher instread - see https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html
I also meet the problem in mac WebStorm, finally found where is wrong:
WebStorm Less compiler only work for ver. less 1.6.2
please use below under your project:
sudo npm install less#1.6.2
then in File Watchers in WebStorm to edit Less watcher,
in Program field change path to:
yourProjectPath/node_modules/less/bin/lessc
then happy css will appear. :)
Whenever I run bower install or any bower command, it ends up running as bundle install or something else from bundler. I'm running a zsh shell with oh-my-zsh. It works as expected in a bash shell.
Example output:
% bower install
bundle install requires at least 0 argument: "bundle install".
Running whence -p bower yields /usr/local/bin/bower, which is symlinked to /usr/local/lib/node_modules/bower/bin/bower.
Running /usr/local/bin/bower install works just fine. I'm thinking there is a place where bundle or bower has been aliased wrong, or oh-my-zsh's autocomplete isn't working properly, but I can't imagine where that would be. I could add alias bower='/usr/local/bin/bower' to my .zshrc but I'd like to solve this properly.
Thanks for any help.
Had the same issue. Removed the bower plugin from my .zshrc file and everything started working again.
Use whence -vs bower to find zsh's interpretation of bower. -v will add the type if it's not a command, -s will also show a symlink-free path in case the pathname contains symlinks.
whence -p bower does a path search even if it is an alias or function and will only return found paths but nothing else. So this will not help you to find if it is an alias.
I personally fixed this by uninstalling and reinstalling bower and bundler. However, it seems (as I thought) that ZSH was somehow overriding one with the other. #m_gol has been kind enough to submit a fix in oh-my-zsh to fix this.
I'm going through the Sass tutorial and am stuck at this part:
Once you have Ruby installed, you can install Sass by running
gem install sass
So I opened up command prompt and typed in
gem install sass
Just like it said. It doesn't work though. I get this message back:
'gem' is not recognized as an internal or external command, operable program or batch file.
I have almost no knowledge of command line but wish to use Sass. Can someone please walk me through what I'm doing wrong?
Yes I did searches for tutorials for people who don't know command line. I only came up with a Mac guide, which does me no good since I'm on Windows 8, and a program that my company has blocked access to.
This just means the gem executable is not in your %path%. You can either run the ruby installer again and select the check box during the install for "Include ruby in path" (or some similar message) or just add the path (something like C:\Ruby200) to your system %path% variable.
Use Ruby Installer for Windows to install Ruby. After that you'll be able to do gem install sass.
Also, i recommend you get familiar with Compass as soon as possible. Compass is a very ambiguous thing for newcomers, so here's an explaination for you: Import common modules by default when compiling SCSS
And here's a great source of information for SASS newbies: https://github.com/Snugug/training-glossary/wiki