tower-archive / tower

UNMAINTAINED - Small components for building apps, manipulating data, and automating a distributed infrastructure.
http://tower.github.io
MIT License
1.79k stars 120 forks source link

Installation Issues #401

Closed ghost closed 10 years ago

ghost commented 11 years ago

Hi,

I've been following the documentation, try to get tower installed through NPM.

I've ensured that I've got coffee-script, grunt and mocha installed. I've clean the NPM cache. I have even tried uninstalling and re-installing NPM. I've uninstalled and re-installed the packages a number of times.

But, every time I try tower -v, I get "No command 'tower' found ...". I've tried running it as my own user, as well as sudo.

Any ideas?

ghost commented 11 years ago

Some more information ....

I've re-installed everything from scratch, including a new Ubuntu VM, new node.js install, new NPM install, again all the prerequisites, and then finally tower.js. Still getting the same "No command 'tower' found ..".

So, I've installed derby.js on the same machine. Worked 100% out the box, first time round.

Has anyone else experienced the same issue?

Thanks!

lancejpollard commented 11 years ago

Hey, have you installed with npm install tower -g?

It looks like we left that off the README.

ghost commented 11 years ago

@viatropos, yes I have installed tower and all the prerequisites as global.

lancejpollard commented 11 years ago

@casgit hmm.. it looks like the tower/cli module's executable isn't being set when installed globally. For now try installing tower-cli globally:

npm install tower-cli -g
ghost commented 11 years ago

@viatropos, ah now we're getting somewhere. I can execute the tower command now, but when trying to cerate a new app, I now get this message: "Cookbook [app] not found.".

lancejpollard commented 11 years ago

@casgit nice :)

hmm, which docs are you following? we've changed the ways the generators work since 0.4.0, so generators are just built from cookbooks. But I don't think we've done the last bit to have default generators yet, try this (what's your OS by the way?):

# cd into home directory
cd ~
# create a .tower folder (your "workstation")
mkdir .tower
cd .tower
# add a simple package.json to it
echo '{"name":"tower-workstation"}' >> package.json

Then from within that .tower directory, try installing the component-cookbook:

npm install tower-component-cookbook

Now the component cookbook should be accessible from the CLI. You can use it like this (from any directory):

tower create component my-component

We haven't gotten to the app-cookbook yet really, we wanted to flesh out the basics first, so it's open to suggestions.

What I've been doing personally (for the moment, to create custom cookbooks) is just tower create component x, and then add a "cookbook": "x" to the package.json for it (see the component-cookbook for the implementation details). That makes it so you can do tower <action> <cookbook-name>.

You can also just clone the component-cookbook into that .tower/node_modules/ directory, and customize the generator however you'd like.

Let me know how that goes for you.

lancejpollard commented 11 years ago

This setup stuff should all happen when the CLI is installed, just haven't been able to get to it.

Basically, when you npm install tower, it should install the CLI and give you the command, and also create the basic "workstation" setup like above (just creating that .tower directory pretty much).

Then it should install a "cookbook" cookbook, and maybe a few default cookbooks, so you can get off and running with generators and other cool things, just from running npm install tower. At the same time, it should be set up so when you install tower on the production server, it doesn't add this extra stuff. So maybe this means you have to install cookbooks manually all the time, not quite sure yet.

Thoughts?

ghost commented 11 years ago

@viatropos I've used the docs on towerjs.org. I'm going to try the cook-book install now, and will let you know.

ghost commented 11 years ago

@viatropos So, once I have installed the app-cookbook and created the component, should I be able to run tower new without any issues?

lancejpollard commented 11 years ago

@casgit so the way cookbooks work, it's all just tower <action> <cookbook>, where "actions" are just methods on the module exports for your cookbook.

But, tower new my-app is just a special case for getting started, it just delegates to tower create app my-app.

https://github.com/tower/cli/blob/master/bin/tower#L159-L177

ghost commented 11 years ago

@viatropos Awesome! Thanks for all the help. Where do I find the official docs for tower? Is it on towerjs.org?

lancejpollard commented 11 years ago

@casgit awesome, yeah the official docs are on towerjs.org in the guide section, which is just generated from this:

https://github.com/tower/guides/tree/master/guides

yudho commented 11 years ago

I experienced same problem where it shows "Cookbook [app] not found" and "Cookbook [component] not found". I have went through your workaround by installing tower-component-cookbook. It was successful, now "tower create component my-component" works perfectly. However, the app cookbook still has problem. I would be glad if you could show me some workaround for that problem. Thanks

lancejpollard commented 11 years ago

Hey @yudho I'll be in the IRC for the next hour or two if you want to dig in.

I haven't gotten to the app cookbook yet, still working on the directives. Got an awesome lightweight setup for data binding just about finished.

yudho commented 11 years ago

sure..what s the channel?

yudho commented 11 years ago

@viatropos , is it possible to build a new app without app cookbook? and looking forward to that awesome thing :)

lancejpollard commented 11 years ago

@yudho #towerjs is the channel. Yeah you don't really need the app cookbook right now, you could just manually start building an app from scratch. That was one of the goals this time around, make it so you could just have a single index.html and one index.js, and just build your app, that's all it really takes.

The todomvc app is a demo, though it needs to be cleaned up and updated with the latest code:

https://github.com/tower/todomvc