Zurb Foundation SCSS: Can't find bower - ruby

I'm trying to create a new foundation project with Ruby through the Windows command prompt. Every time I try to create a new project I get this error message:
Can't find bower. You can install it by running: sudo npm install -g bower
What is the Windows command for this? I've tried gem install bower but still get the same message.

To use Bower on Windows, you must install Git correctly. Install Git first and then use git prompt to install bower. Download and install Git for Windows

Related

Could not execute command lessc' while running odoo (any version) in eclipse mac

After a thorough analysis of 'Could not execute command lessc' i've successfully ran odoo (any version) on my command line with python virtual env. Am doing this to run odoo in command line
$ . {PATH_TO_VIRTUAL_ENV}/bin/activate (Running the script in the current shell)
$ cd {PATH_TO_ODOO_SOURCE}
$ ./odoo.py -c setup.cfg
And the above runs with proper UI.
Now when trying to run the same from eclipse throws me 'Could not execute command lessc'. I did the below to run code from eclipse
Installed pydev plugin in eclipse Mars
Configured Python interpreter (Given the virtual env python path here. i.e {PATH_TO_VIRTUAL_ENV}/bin/python)
Setup odoo source
Specified the new python interpreter on the project properties -> python interpretor
Created a new Run Configuration to run the source with the custom setup file and with the new interpretor
Kindly throw me light on places where i miss. Also i've gone through links on setting up python virtual env in eclipse. They all say the same thing still this lessc dependency is somehow not linked. Please comment if you require more info to identify the error. Thanks for your help! :)
FYI am using mac.
Update
For Shikhar (based on his answer)
This problem is related to your bad configuration of Nodejs and less on system.
Use commands below to resolve this -
wget -qO- https://deb.nodesource.com/setup | sudo bash -
then
brew install node
and finally
sudo npm install -g less less-plugin-clean-css
This will resolve the lessc command issue.
try this
sudo apt-get install node-clean-css
sudo apt-get install node-less
The solution:
sudo apt-get install node-clean-css
sudo apt-get install node-less
may work for Global system installation but if you are working within a virtualenv you may try this.
If somebody had the issue inside PyCharm wich was my case and nothing else works...
I leave my solution here:
First: I tried to check if node and npm exist inside my virtualenv: node -v and npm -v, not any of them... Second: I was using virtualenv, also when I ask inside my virtualenv with: which lessc . I didn't receive any response neither, so... I keep googling and found this post: How to install lessc and nodejs in a Python virtualenv?
In any case this was what I did on my virtualenv and the problem was solved:
MYVIRTUALENV/bin/activate # switch to my Python virtualenv first
pip3.7 install nodeenv # install nodeenv nodeenv was installed, in case you are using python 2.x use pip instead pip3
nodeenv --python-virtualenv # Use current python virtualenv
npm install -g less # install lessc in the virtualenv
npm install -g less-plugin-clean-css # also install this less-plugin...
then if I check with node -v and npm -v I get a proper response...
also get good response on: which lessc
After that no more nightmare with lessc execution in pycharm

Windows 7 - How to resolve “You need to have Ruby and Sass installed and in your PATH for this task to work” Warning?

Most answers and solutions are related to OSX, it is focused in Windows 7:
I have installed Grunt & Grunt CLI globally. Then I did a npm install inside a project folder to install all dependencies.
No problems so far, but as soon as I try to run the "grunt build" command, I get this warning in my project:
Warning: You need to have Ruby and Sass installed and in your PATH for
this task to work. More info:
https://github.com/gruntjs/grunt-contrib-sass Use --force
to continue.
Ok. This worked for me:
1) Download Ruby from http://rubyinstaller.org/
2) When you install, check the 'PATH' option. This is the key.
3) Once installed, open the prompt (you can use interactive ruby) and write
gem install sass
Now it should work.
Let's consider that newbie people most of the time try to use these commands:
npm install ruby
npm install sass
It won't work.
Solution:
Download and install Ruby from here “http://rubyinstaller.org/”
Execute in a command prompt window “gem install sass”
Only downloading Ruby independently it works. If you try npm install ruby it won't work.
Hope it helps to solve this problem in your case.
To avoid the need of Ruby, you can try this:
npm uninstall --save grunt-contrib-sass
npm install --save node-sass grunt-sass
Source:
https://github.com/gruntjs/grunt-contrib-sass/issues/229#issuecomment-281284894

How to start foundation on windows?

I have installed Ruby, NodeJS, Bower and etc to install zurb-foundation project on windows. Project was installed successfully. How to open it in browser to begin development?
Here's how you do it for the Windows 7 if you want full access:
Install Ruby (you can use http://rubyinstaller.org/ but dont forget to check "Add Ruby executables to your PATH")
Install NodeJS
Install Git
install Ruby Development Kit
Open the Git Bash and run: npm install -g bower grunt-cli gem install foundation "gem install wdm" gem install compass --pre
Navigate to the folder where you want to create demo project.
in windows context menu(left click) select Git Bash here and run: foundation new <NAME> it will create demo project and if you want to edit its style then also run cd <NAME>/ compass watch and any change to the scss files will be compiled to the app.css

fine-uploader example traditional build

So, I'm trying to evaluate fine-uploader. I decided to go to the download page, but it wants you to purchase a license, but I don't want to do that until after I've evaluated it. So, I went to github and downloaded the master zip for it and unzipped. My question is now what? The so-called "step-by-step" are not step-by-step. Am I supposed to build something? The documentation states I just need to include one file....which file? In the demos, for traditional use, i see it includes fineuploader-{VERSION}.js, but I see no file that even starts with "fineuploader" in the subdirectory of "client/js/*".
Am I just missing the documentation for this completely?
Thanks!
Following Bjørn Børresen's answer, the official documentation (which is severely lacking) and some troubleshooting, I was successfull on Ubuntu 13.10 with the following commands:
sudo apt-get install npm git
sudo npm install -g npm
sudo npm install -g grunt-cli
sudo npm install -g bower
git clone https://github.com/Widen/fine-uploader.git
cd fine-uploader
npm install http://github.com/e-jigsaw/grunt/tarball/fix-underscore-string-version
bower install
sudo npm install -g
npm install grunt
npm install
grunt package
You'll need git, NPM, Grunt & Bower.
Assuming you have git, if not install it. Then navigate to http://nodejs.org/ and INSTALL NodeJS.
From the command line:
npm install -g grunt-cli
npm install -g bower
git clone git#github.com:Widen/fine-uploader.git
cd fine-uploader
bower install
npm install -g
grunt
These are the steps that worked for me on Windows 7:
I. Install Prereqs (should only be necessary the first time)
Install node.js on windows if you haven't already.
Ensure npm has been added to your PATH variable (as of this writing, node.js puts this in during install):
%USERPROFILE%\AppData\Roaming\npm
Install git on windows if you haven't already.
Ensure the git commands have been added to your PATH variable (as of this writing the git install does not add these):
C:\Program Files(x86)\Git\bin;C:\Program Files (x86)\Git\cmd
Open command prompt.
Install grunt globally:
npm install -g grunt
Install grunt-cli globally:
npm install -g grunt-cli
Clone the repo if you haven't already:
git clone git://github.com/Widen/fine-uploader
Change command prompt directory to repo location (most likely at %USERPROFILE%\fine-uploader).
Install dependencies (if you want the dependencies installed
globally add a -g below but it is not necessary):
npm install
II. Build and Package
Open command prompt at the repo location (i.e. %USERPROFILE%\fine-uploader)
Pull latest, if necessary:
git pull
package it up:
grunt package
This should result in the files being added to the _dist folder in your repo.
The build and distribution methods have changed quite a bit over the past couple years. As of Fine Uploader 5.11, you have the following options:
Download Fine Uploader from npm
npm install fine-uploader
Download Fine Uploader from the project's home page
...at http://fineuploader.com/customize
Build Fine Uploader yourself from the GitHub repo
git clone https://github.com/FineUploader/fine-uploader.git
cd fine-uploader
npm install
make build
The "contribute code" section in the README contains even more details.

Why does Grunt not add itself to the shell?

I have a problem installing grunt. All the documentation, and blog post tutorials, say that running:
npm install -g grunt
will then allow you to run grunt commands from the terminal.
I have a situation where grunt appears to install with no errors, but typing the command grunt in the terminal still gives:
-bash: grunt: command not found
What could I be doing wrong? And where could I find grunt to add it to my BASH profile manually?
Since Grunt version 0.4 (which was released 1 or 2 weeks ago) you need to install the grunt command line tool globally (if needed, use sudo before the command):
npm install -g grunt-cli
In your project location you then install the latest grunt version:
npm install grunt --save-dev
Option --save-dev will save the npm config in your package.json file, which makes it easier to install or reinstall the dependencies (using just npm install).
Try running the install with the verbose flag:
npm install -g grunt --verbose
You can see where it is being installed (something like /usr/local/share/npm/bin/grunt). Then check your path:
echo $PATH
If the path does not contain the install bin location, modify the path in your bash profile to include the location of the bin directory, then try grunt again in a fresh terminal.
UPDATE: Grunt 0.4 altered installation process. For 0.4 installs, see answer from asgoth below.
It seems that grunt in the current version 0.4.0 does not install a bin command. The last 0.3.x version is 0.3.17, which supports a bin command. To run grunt from the command line, you will want to install the grunt command line grunt-cli:
npm install -g grunt-cli --verbose
I had installed node using Homebrew and this was my solution:
set config for -g (GLOBAL) install directory directory: npm config
set prefix /Users/YOURNAME/.node/
make sure to edit PATH: sudo nano ~/.profile
add to path: export PATH=“/Users/YOURNAME/.node/bin:”$PATH
then update source: source ~/.profile
Following these steps will allow any packages installed using npm install -g somePKG to be placed in the correct location regardless of your current working directory. And by updating your $PATH correctly command line functions will work.
Information based on:
Fixing npm permissions - bit.ly/1CmIyqx

Resources