zurb / foundation-apps

The first front-end framework created for developing fully responsive web apps.
http://foundation.zurb.com/apps
MIT License
1.58k stars 216 forks source link

Error installing foundation-cli on Windows #203

Closed jsmreese closed 9 years ago

jsmreese commented 9 years ago

I see this error when I run npm install -g foundation-cli on Windows (Windows 7 64bit):

image

gerrytucker commented 9 years ago

Same here on Windows 8.1 64-bit.

gakimball commented 9 years ago

I'll look into it, but thankfully that step of the process is just a welcome message—it doesn't set anything up.

jsmreese commented 9 years ago

@gakimball It might not set anything up, but I'm still unable to use the cli after that step. foundation-apps new myApp just returns sh: foundation-apps: command not found. Not sure if I'm missing something obvious...

peterblazejewicz commented 9 years ago

@gakimball will this help? https://github.com/roots/roots/commit/97f5f34b0378f95d6da8c162de884364c6e6101c something like:

"postinstall": "node lib/welcome.js"
gakimball commented 9 years ago

That might work. Also, the source code for the CLI is here, in case anyone who knows more about Node than me can help :)

https://github.com/zurb/foundation-cli

gakimball commented 9 years ago

@jsmreese I can see in your screenshot that it's connecting the CLI's main JavaScript file to a command on your system (C:\Users\John...\npm\foundation-apps), is that command there at that path?

dhye360 commented 9 years ago

Same problem here on windows as admin. Error must interrupt install as foundation-apps isn't found installed locally or globally.

@jsmreese do you have Ruby? I was trying to get as far as I could without it, but if it won't even install....

gakimball commented 9 years ago

@peterblazejewicz I implemented your fix, which should solve the problem.

npm update -g foundation-cli
gerrytucker commented 9 years ago

Now working after 1.0.2 update, thanks very much everyone!

gakimball commented 9 years ago

Awesome! @jsmreese @dhye360 @peterblazejewicz let me know if it works for y'alls.

gerrytucker commented 9 years ago

I spoke too soon!

image

benjaminzanatta commented 9 years ago

Same for me on Windows 7 64bits

capture

dhye360 commented 9 years ago

@gakimball Same error as @gerrytucker for me

gakimball commented 9 years ago

Alright, I'll look into it. Thanks so much for being helpful and patient, guys :)

In the mean time, you can do what the installer does by hand:

npm install
bower install
bundle
gerrytucker commented 9 years ago

Had to downgrade my Sass gem to 3.4.7 before I could complete the manual commands but now have a newly created app :-)

nandroid commented 9 years ago

Same error. I don't know how to downgrade...

FlatspinZA commented 9 years ago

I tried everything - the only way I could get this working was the manual installation, and that was after having to sort my SSL certificates to install the Bundler gem.

Thanks for the help, guys.

gerrytucker commented 9 years ago

@nandroid Which version of the Sass gem do you have? gem list sass

To install Sass@3.4.7:

gem install sass -v "3.4.7"

I was on sass@3.4.9 which I uninstalled as follows:

gem uninstall sass -v "3.4.9"

Hope this helps.

Gerry

cjwilson252 commented 9 years ago

I've managed to get it running by downgrading my sass to 3.4.7 and it worked, thanks gerrytucker .

dhye360 commented 9 years ago

I caved and installed Ruby, but gem install bundler doesn't work so while I could install foundation for apps; I can't successfully bootstrap one

but i'm Ruby/Sass ignorant and an overall foundation N00B

gerrytucker commented 9 years ago

@dhye360 ensure you've got the sass gem installed, required version as mentioned above is 3.4.7:

gem install sass -v "3.4.7"
AntJanus commented 9 years ago

@gakimball I fixed 2/3rd of the commands so that most of them should work now. The problem is on the Node side (or perhaps Windows side?) where exec only runs executables, not scripts or whatever else. For some reason npm works with npm.cmd and bower works with bower.cmd. However, I couldn't get bundle to work at all. I'm not a 100% sure why.

I noticed that the gulp-ruby-sass package uses win spawn which allows for cross-platform exec and spawn. I'll give regular spawn a shot as it might work better.

jsmreese commented 9 years ago

I had both sass 3.4.7 and 3.4.9 installed. Uninstalled both, reinstalled 3.4.7.

Almost there... I'm seeing this error from gulp's output (added trace: true to the sass call): image

AntJanus commented 9 years ago

I changed a few things around. As long as bundler and ruby are installed correctly, the cli should work right (note that it hasn't been tagged and released yet). I changed a few things around, implemented a few fixes from win spawn and successfully installed several apps (just to make sure it works!).

@jsmreese I'm running a similar setup (jruby 1.7.15, Sass 3.4.7 and I'm on Windows 8, best windows there is). Sass was installed via bundler (the gulpfile specifies bundleExec on the command too). I wonder if that makes a difference?

jsmreese commented 9 years ago

Booya.

I uninstalled jruby 1.7.16.1 and installed jruby 1.7.15.

gem install bundler sass as instructed, but that installs sass 3.4.9, which doesn't work with gulp-ruby-sass.

gem uninstall sass gem install sass -v "3.4.7" npm start

And it builds.

Thanks for the help @AntJanus @gakimball @gerrytucker!

narration-sd commented 9 years ago

AntJanus, I reinstalled foundation-apps on Windows 8.1 about 4 hours ago, I think with your changes as it acted differently. This time it worked until the bundle step.

I experimented to see what bundler command was actually available, and found that bundler.bat was.

I changed line 97 of foundation-cli.js as follows, to suit:

var bundleInstall = ['bundle.bat'];

Now everything works. I could run foundation-apps new myApp, and then after, go to the myApp folder and successfully run foundation-apps watch, which compiled all and launched the localhost:8080 miniserver so could see it.

Hope this suggests how you can finish the update, if not just use.

Thanks for the work, Clive

FlatspinZA commented 9 years ago

As far as correcting the native Foundation-Apps installer is concerned, I can only go with narration. http://railsinstaller.org/en Rails Installer installs Bundler on Windows.

narration-sd commented 9 years ago

Great, Flatspin.

i was thinking this morning that the way Zurb could write code like this to be robust would be to make it adaptive. Instead of assuming executable names, a search could uncover what is actually available. Then plug the values into code like this one.

It's a tried and true way - a natural language system I wrote for Bell Laboratories worked for an additional 18 years, partly because it was in its framework adaptive this way.

gakimball commented 9 years ago

@narration The initial hope was to use more portable libraries, but it didn't totally pan out. For example, we were going to use nodegit, which is a portable version of Git for Node, but it wasn't able to clone over HTTPS, so we couldn't use it. Some of the Node-based tools we use or have considered using are in active development, so sometimes things get weird.

Seeing the issues that have cropped up, though, I think we'll take another look at it. Bower and NPM both have programmatic APIs, although Bower's isn't too thoroughly documented from what I can tell. But we can make it work! The only odd bird is Bundler, although the codebase is very close to working with libsass, at which point we can just drop Ruby from the stack entirely.

AntJanus commented 9 years ago

@gakimball The bundler thing is weird since the method I used should have covered every case. It literally uses a secondary process to run a command. Should've been foolproof, It's what ruby-sass uses to run their command so I'm pretty surprised it doesn't work! O.O I can try to integrate the win-spawn package that has a more robust cross-platform solution. I can't test it for others though so it'd be a hit/miss situation.

@narration I have Windows 8.1 64-bit just as you do. The weird thing is, I tried bundle.bat and it failed that's why I resorted to the solution I have which really should have been a slam dunk, a last resort that should work no matter what. This discrepancy among the same operating systems sucks. Can't imagine why.

Out of curiosity what version of Ruby are you using?

narration-sd commented 9 years ago

@gakimball - good to understand. Of course libsass has had its innings vs. others lately, as you'll know well at Zurb. Frankly the whole arena is fraught, but it is what we have, isn't it ;) I was starting to agree with going away from Ruby, but frankly it's involved in so many of these tools that if I were doing it, I think I'd rather fish out the variation parts between the Rubys, and adapt as above. Just an opinion.

@AntJanus - in answer, ruby -v says ruby 2.0.0p481 (2014-05-08) [x64-mingw32]. Note the MinGW, which I am running rather than cygwin, on basis of sorting out another one of these layered tool problems. I suspect the difference in recognizing executables might be at that level, the pseudo-OS, rather than Ruby. Why that Ruby? Its line was recommended I think by Zurb a while ago, and although I saw the local hint that maybe JRuby might work and even downloaded it, I have too many other gems running on this Ruby to want to bother them. Perils of Pauline for anyone who tries.

Then, as above, I'd rather adapt within your Zurb scripts to handle the permuted combinations of pseudo-OS and Ruby arrangements. Just looking for what you need, like an executable name for bundle. It seems likely the most fun and least trouble, and may be thought to be more stable also as the other packages aren't likely to change their ways of working, while swapping out packages as Zurb has been doing on the main Foundation line almost guarantees user shock and troubles, no?

p.s. if you did it the adaptive way, the proposed stability of the individual package layer calling conventions might say you could just make a table of the relevant ways to call, based on the environment of systems. That way you can do what I did and try things from shell within the environment to discover what's accepted, thus wouldn't have to have seeking code within your script library. Rough but maybe ready enough here?

tnedich commented 9 years ago

I have installed dependencys manualy: npm install bower install- bundle ---------------- > SSL certification problem

Then used:

gem install sass -v "3.4.7"

Now everything works ! :)

FlatspinZA commented 9 years ago

For anyone battling with the SSL certification problem:

You need to specify the location of your SSL Certificate.

The solution is provided here: https://gist.github.com/fnichol/867550

nandroid commented 9 years ago

Thanks, @gerrytucker. But I started from scratch, and now I can't install bundler or downgrade SASS.

C:\Users\nandell>gem install bundler ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://api.rubygems.org/latest_specs.4.8.gz)

C:\Users\nandell>gem uninstall sass -v "3.4.9"

C:\Users\nandell>gem install sass -v "3.4.7" ERROR: Could not find a valid gem 'sass' (= 3.4.7), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://api.rubygems.org/specs.4.8.gz)

C:\Users\nandell>gem install builder ERROR: Could not find a valid gem 'builder' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://api.rubygems.org/latest_specs.4.8.gz)

AntJanus commented 9 years ago

@FlatspinZA thanks for posting that!

AntJanus commented 9 years ago

@narration using a table of possibilities could end with a lot of issues. However, I retested your solution this morning and it seems to work. Not sure why it didn't work me earlier. Definitely much simpler than my solution.

Also, much to my displeasure, it looks like I never published the bundler fix in the first place -.- >.<

Everything is updated now and working.

narration-sd commented 9 years ago

@AntJanus, of course that's so, as far as a table. I was just trying to suggest something easy as an entry point to adaptive approaches. There is of course a 'table of one' at present ;)

Dynamic checking of what's available will be the robust approach, seems sure. I think we really need to do things like this to release a dependable product, when it depends on a host of individual and dynamic external tools, especially those that take unusual freedoms because they are not corporate. Also because people are naturally going to have their own mixes of available tools.

Giving something to gain the advantages, and also will help in those last minute times, where quite appreciated that you stuck with it.

Cheers from San Diego, environs anyway.

viztastic commented 9 years ago

@gakimball When do you expect a 1.0.1 release could be ready to address ^?

Thanks!

gakimball commented 9 years ago

@viztastic Well, the framework came in a little hot last week, so we'd just like to get a slightly more stable version out for people using the framework this early. It's just a lot of little bug fixes.

The Bower package is also currently missing the _settings.scss file, so if you install the framework standalone that file isn't as easy to find.

Nielstm commented 9 years ago

@gerrytucker @benjaminzanatta @dhye360 @gakimball

Ik had the same error on Windows: Error: spawn ENOENT at errnoException (child_process.js:1011:11)

The solution for me was to install git for Windows on http://git-scm.com/ en restart my pc.

gakimball commented 9 years ago

Can any Windows users help us test a new build of the CLI? We're working on improving error-handling and cross platform support.

Here's how to run the test install:

git clone https://github.com/zurb/foundation-cli.git
cd foundation-cli
npm install
npm test

If all goes well, you'll see three green check marks at the end of the install. If you get an error, please paste it in here so we can take a look. Thanks!

tnedich commented 9 years ago

Win 7 Ultimate 64-bit io.js platform

foundation-cli@1.0.4 test C:\Users\Admin\Desktop\zurb-test\foundation-cli ./bin/cli.js new test

'.' is not recognized as an internal or external command, operable program or batch file. npm ERR! Test failed. See above for more details.

gakimball commented 9 years ago

@tnedich Fixed that: 3d9b47

The command should at least start now.

tnedich commented 9 years ago

Now it starts and there is one red mark :)

Win 7 Ultimate 64-bit io.js platform

✗ Ruby gems not installed. Try running bundle manually.

gakimball commented 9 years ago

Hmm, well luckily we're going to remove Ruby from the install process entirely, so I won't stress about that. The Git, npm, and Bower parts working are the most critical.

jgamao commented 9 years ago

I am using Ubuntu 14.04 LTS in releasing my game but I also have this error.

I am also using nodejs.. Can you help me to solve this?

gakimball commented 9 years ago

@jgamao Which error are you getting? And is it with the current CLI or this test version?

fhassan2014 commented 9 years ago

Here is the error for above test install.

error

gakimball commented 9 years ago

@fhassan2014 Ah, sorry about that, there was a line of debugging code I left uncommented that forces an error to happen. If you have time, could you try testing it again? I'd appreciate it :)

fhassan2014 commented 9 years ago

Hi There,

I'm new on Foundation-apps, Creating new app and install dependencies all are fine but when I gulp(build) the project it gives me some errors and this css file " assets/css/app.css " is missing.

here are errors while building project.

image