Menu icon Foundation
Foundation can't find NodeJS

I have installed Foundation via the RubyInstaller.org package and I installed NodeJS separately. Installation of the foundation gem worked fine however when I try to create a project I am hit with the error message "Can't find NodeJS. You can install it by going here: http://nodejs.org" despite me having it installed.

I'm running all this from my windows machine and this error is coming up when I try to create a new foundation project from the ruby command line. I have noticed a few people with the same problem but the only solutions are for Ubuntu environments and I'm not running that. Does anyone know what I can do to resolve this problem?

Many thanks

Allan

nodejsFoundationrubyrubyinstallercantfind

I have installed Foundation via the RubyInstaller.org package and I installed NodeJS separately. Installation of the foundation gem worked fine however when I try to create a project I am hit with the error message "Can't find NodeJS. You can install it by going here: http://nodejs.org" despite me having it installed.

I'm running all this from my windows machine and this error is coming up when I try to create a new foundation project from the ruby command line. I have noticed a few people with the same problem but the only solutions are for Ubuntu environments and I'm not running that. Does anyone know what I can do to resolve this problem?

Many thanks

Allan

Tom Hogan over 5 years ago

Hi Allan,

I just installed nodejs yesterday and ran into a similar problem and this is what solved it for me.

nodejs creates a package manager called npm. this package manager can be found in your c:\users\YourName\AppData\Roaming\npm folder. In order for commands using the package manager to execute it must appear in your Windows environment path.

If you go to Start and type "path" in the search box you'll see "edit environment variables for your account"
click on it and your environment variables window will open. The top portion of the box will say "User variables for YourName". In the window will be a path statement and the full path to you npm folder should be there. if it's not, add it.

Next, look below under "System Variables" and see if the path to your npm folder is there. If not, add it to the beginning of your path statement. Be sure to separate the path you add from other paths with a ";" so path=C:\path\to\npm;C:\netx\path;

When I installed nodejs it included the path to my user variable window but when I added it again to the system variable window everything worked as advertised.

Let me know it this helps

Allan Kendall over 5 years ago

Thanks for that I think it's cured the problem but now if I try to make a new project it says it can't find Bower "Can't find bower. You can install it by running: sudo npm install -g bower"

So I tried that and I got "sudo" is not recognised as and internal or external command." This is becoming a right carry on..

Tom Hogan over 5 years ago

Allan,

Glad it was helpful... I forgot to mention that when you change the path, close the DOS window and reopen it before seeing if it works.

SInce you're using Windows, sudo won't work. it's not a recognized command. Use Node Package Manager (npm) to install Bower. Use the “-g” (global) switch you can install Bower from any directory.

Go to your Bower directory and type "npm install -g bower" Remember that npm statements are case sensitive.

Next you need to test Bower installed

Underneath your Bower directory you'll see a subdirectly called app. Since you will want to install the dependencies in the “app” direction, navigate to the “app” directory” Type "cd app".

Do a Bower search for jQuery. Remember, it is case sensitive. Type "bower search jQuery"

You'll should see a bunch of libraries scroll across your screen... it's all good. it means Bower installed properly.

Next you'll need to install Git and jQuery :)

let me know it worked.

Allan Kendall over 5 years ago

Hmmm I question whether bower is installing at all, when I type in "npm install -g bower" it runs through a list of files and flicks between GET and 304 (no errors though). When it stops running I have no idea where the directory is, I check under:

c:\users\myname\AppDate\Roaming\npm\bower and bower.cmd

I did a full search and there is no director called app anywhere on my pc so I must be doing something wrong here.

Tom Hogan over 5 years ago

You need to create the directory before you begin and navigate there to install Bower. Sorry, I thought you created it when you tried running the sudo command.

Create the following:

c:\bower\app

Navigate to c:\bower and type "npm install -g bower"

Allan Kendall over 5 years ago

At last I have it installed. There were a couple of additional steps not covered in any documentation to get it to work, for example when you installed GIT you should select the second option during the process "Use GIT from the Windows Command Prompt". Having previously taken the default options this was something I had overlooked and I'm not the only one.

Now I have made my new Foundation 5 project from the ruby command line I'm happy BUT what next? Since there are sass files and css files in two different directories do I still need a compiler (I used to use Koala), how to I compile my SASS files??

Many thanks for them help so far.

Tom Hogan over 5 years ago

Not sure what you mean by "...made my new Foundation 5 project from the ruby command line..." or that you have SASS files and CSS in two different directories.

I'm a bit lost as to where you are in the process but Ok.

Zurb uses bower to manage the updating process of Foundation. After installing all the dependencies you need to run "npm install -g bower grunt-cli" from the command prompt (no quotes).

Then you should install the Foundation cli by running "gem install foundation" from the command prompt (again no quotes).

After the above is created, you'll use Grunt and Libsass to compile your SASS stylesheets.

First, create a New Project. Then navigate into the directory where you want all the files to be created. cd\path\to\MyNewProjectRoot

Next you'll use the Foundation cli that you just installed to create all your new project files in your New Project root directory.

Type without quotes: "foundation new project_name --libsass" and see the magic happen.

In your New Project root, you should see a bunch of newly created files such as: .bowerrc, gitignore, bower.json, package.json, index.html, etc. There will also be a bunch of subdirectories created such as .git, bower_components, css, js, node_modules and scss.

If you see all that CONGRATULATIONS! You're ALMOST there.

Next, you need to use Grunt to compile everything before you start working:

From you NewProject root directory type: "grunt build"

To compile changes as you work type: "grunt watch"

To update Foundation type: "foundation update"

That's it! EASY PEAZY!!

Now all I have to do is spend the next year learning everything I just did.

Hope this helps. (if it does check the HELPFUL box! :) )

Tom

Tom Hogan over 5 years ago

All,

After spending some time getting Grunt and Libsass along with Ruby, Bower, Git, NodeJS, etc. up and running on Windows, I created a step-by-step How-To that some may find helpful.

http://foundation.zurb.com/forum/posts/11597-how-to-install-grunt-and-libsass-on-windows

Tom

Allan Kendall over 5 years ago

Oww, I've bookmarked that, good effort there mate. I'm now up and running with it all and it's good, I'm not a huge fan of using grunt to compile the SCSS as Koala did the same thing but looked a lot slicker and was more friendly, the ruby command prompt running with grunt watching. It's error message are sometimes not as clear as Koala either but this is just my personal experience and preference.

Tom Hogan over 5 years ago

Glad you found it helpful Allan.

I'm just beginning to learn SASS so I have no experience with either grunt or Koala. I have figured out that I'll need to spend some time learning grunt as it appears that there are a number of plugins that will make life a bit easier.

Maybe I'll create a "Grunt for noobs" post that will help pave the way for others new to the program.

Cheers!

Tom

Andrew Revinsky almost 5 years ago

Here's what has been wrong in my case. Hope it helps someone.

Make sure the paths to Nodejs and NPM are not enclosed in quotes ("). This is crucial, as the generator code simply permutates all sub-paths of the PATH env variable with the known exec extensions in PATHEXT env variable.. and concatenates the value to find the right file.

So, you want it to come up with at least this (on Windows):

C:\Program Files\nodejs\/node.EXE

and surely not this:

"C:\Program Files\nodejs\"/node.EXE