Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Windows install bug (0.4.2-4) #311

Closed
ricick opened this Issue · 63 comments

8 participants

@ricick

npm install tower -g fails with this error on win7 64

C:\Users\Phil\AppData\Roaming\npm\tower -> C:\Users\Phil\AppData\Roaming\npm\nod
e_modules\tower\bin\tower

> tower@0.4.2-4 postinstall C:\Users\Phil\AppData\Roaming\npm\node_modules\tower

> $(./bin/dependencies)

'$' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! tower@0.4.2-4 postinstall: `$(./bin/dependencies)`
npm ERR! `cmd "/c" "$(./bin/dependencies)"` failed with 1
npm ERR!
npm ERR! Failed at the tower@0.4.2-4 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     $(./bin/dependencies)
npm ERR! You can get their info via:
npm ERR!     npm owner ls tower
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files
(x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "tower" "-g"
npm ERR! cwd C:\Users\Phil
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.33
npm ERR! code ELIFECYCLE
npm ERR! message tower@0.4.2-4 postinstall: `$(./bin/dependencies)`
npm ERR! message `cmd "/c" "$(./bin/dependencies)"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Phil\npm-debug.log
npm ERR! not ok code 0
@thehydroimpulse

Yes. This is because Tower's package.json has: (https://github.com/viatropos/tower/blob/master/package.json#L126)

"scripts": {
    "test": "make test",
    "start": "grunt start --config ./grunt.coffee",
    "docs": "make docs",
    "postinstall": "$(./bin/dependencies)"
  }

When you install tower it would run these scripts. The postinstall is the issue as it uses bash functionality. The $ and the ./ are specifically bash. The ./ runs a script locally inside /bin/dependencies/.

To solve this you could

git clone git://github.com/viatropos/tower.git tower

Then edit the packages.json everything inside the scripts key. Make is again not available on windows by default. This is a unix functionality.

After editing the file, open cmd and cd into the tower directory that you downloaded through git.

Type this:

npm link

This will link tower globally through npm. Then when you create an app:

tower new app_name 
cd app_name
npm install

Now again within cmd after installing the modules type:

npm link tower

This will link the edited tower version against this app instead of the default tower module that npm install will download.

Hope this helps.

@lancejpollard

@ricick How would you accomplish the same thing on windows? Would love to work through this with your help, I'll be on #towerjs IRC now for the next hour or two if you're around.

@lancejpollard

Specifically the things to solve for windows are:

  • windows equivalent of executing the $(./bin/dependencies).
  • an alternative to the Makefile (we could just go back to using Cakefile, that's probably easiest).

Most of the Makefile commands are just wrappers around grunt commands, so you should be able to run those.

@lancejpollard

@ricick do the latest changes to master work for you now?

@ginsent

@viatropos Lance, you do an amazing job, thousands of people are constantly checking for updates of tower.js. Another thousands of people, those who on windows, are constantly coming back to see if it started working on their computers. I can tell you, that once it does, I'll probably quit django, and most likely stop watching mojito.

And no, your latest changes to the master didn't work for me yet.

@thehydroimpulse

@ginsent What went wrong? viatropos and I fixed some of the issues but some still remain.

@ginsent

@TheHydroImpulse Hi, Daniel!

I've just run npm install tower -g and got the same problem as the topic starter rickick had:

C:\Users\flyer\nodist\bin\tower -> C:\Users\flyer\nodist\bin\node_modules\tower\
bin\tower

tower@0.4.2-4 postinstall C:\Users\flyer\nodist\bin\node_modules\tower
$(./bin/dependencies)

"$" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
npm ERR! tower@0.4.2-4 postinstall: $(./bin/dependencies)
npm ERR! cmd "/c" "$(./bin/dependencies)" failed with 1
npm ERR!
npm ERR! Failed at the tower@0.4.2-4 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! $(./bin/dependencies)
npm ERR! You can get their info via:
npm ERR! npm owner ls tower
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Users\flyer\nodist\bin\\..\node.exe" "C:\Users\fly
er\nodist\bin\node_modules\npm\cli.js" "install" "tower" "-g"
npm ERR! cwd C:\Users\flyer
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.59
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\flyer\npm-debug.log
npm ERR! not ok code 0

@thehydroimpulse

mmmm. I'm running the same command and it returns fine.

@thehydroimpulse

After trying it inside cmd it does end up failing. I'm guessing that tower on npm isn't up-to-date with the github version. I had replaced the command $(./bin/dependencies) yesterday and if you look in the packages.json file within the scripts: {} it now uses make install-dependencies instead to work with windows.

For now until npm is updated you'll have to do some manual tuning.

First clone the github tower repository and cd into the new directory:

git clone git://github.com/viatropos/tower.git tower && cd tower

Now run:

make install

Once it's finished installing all the dependencies link the local tower repo globally against npm:

npm link

This should install tower. There are a few more bugs that you'll run into when running tower on windows. I'm trying to sort them out, but until then you can somewhat install tower.

@ginsent

The way, described by TheHydroImpulse works. You've got to install make for windows http://gnuwin32.sourceforge.net/packages/make.htm before running "make install".

@ginsent

Okay, this is what I get after npm link:

C:\tower>npm link

> tower@0.4.2-4 postinstall C:\tower
> make install-dependencies

process_begin: CreateProcess(NULL, env node C:\tower\bin\dependencies, ...) failed.
make: `install-dependencies' не требует обновления. (in English: "doesn't require update")
C:\Users\flyer\AppData\Roaming\npm\tower -> C:\Users\flyer\AppData\Roaming\npm\node_modules\tower\bin\tower
C:\Users\flyer\AppData\Roaming\npm\node_modules\tower -> C:\tower

Is this how it supposed to be or something wrong? Cause after that, running "tower new app" or just "tower" or just "node c:\tower\bin\tower" doesn't do anything, i.e. process hangs and nothing happens.

@thehydroimpulse

mmmm. That's a little bit weird. When I run npm link I get:

C:\Users\Daniel\Documents\Projects\tower111>npm link

> chokidar@0.4.0 postinstall C:\Users\Daniel\Documents\Projects\tower111\node_modules\chokidar
> node setup.js postinstall

> fibers@0.6.9 install C:\Users\Daniel\Documents\Projects\tower111\node_modules\fibers
> node ./build.js

`win32-x64-v8-3.11` exists; skipping build

> tower@0.4.2-4 postinstall C:\Users\Daniel\Documents\Projects\tower111
> make install-dependencies

make: `install-dependencies' is up to date.
C:\Users\Daniel\AppData\Roaming\npm\tower -> C:\Users\Daniel\AppData\Roaming\npm\node_modules\tower\bin\tower
C:\Users\Daniel\AppData\Roaming\npm\node_modules\tower -> C:\Users\Daniel\Documents\Projects\tower111

To address the process hanging I found the issue once again. It's within packages/tower/server.coffee#92 and I and viatropos added some windows specific root path trigger but it appears the pull request didn't get the change or I might not have added it. I'll quickly push that up among other fixes to make Tower work on windows.

I'll keep you posted. I just pushed the fixes to my fork of Tower and submitted a pull request. Until it gets accepted you can clone my repo instead: git clone https://github.com/TheHydroImpulse/tower

The procedures are the exact same, hopefully you won't get any errors.

@thehydroimpulse

Windows now somewhat fully works on my end. There might be one last issue in terms of the controllers but other than that it's fully functional!

@ginsent

okay, now git clone https://github.com/TheHydroImpulse/tower works for me as well, after make install and npm link I could successfully run tower new app. But not further, cause after

cd app
npm install

I got a load of errors. But this is probably a subject for another issue. Anyway, how the work progresses is amazing. I'm convinced, that Tower.js has huge chances to become defacto standard web development framework on node.js.

@lancejpollard

Awesome, thanks so much for plowing through this @TheHydroImpulse, it's going to be great having this working on windows!

When you guys get errors on windows, just paste the whole error message in this thread so we can help resolve it faster :)

@TheHydroImpulse not sure why the pull request didn't merge properly, I tried a few times and the lines I saw that differed I also tried just manually changing so I'll try just copy/pasting your two files in a bit (package.json and tower/server.coffee).

Some of the windows bugs are going to be related to paths that aren't built using path.sep or path.join, so if you guys see and fix those, would love pull requests.

@lancejpollard

It should fully work on windows now! Let me know if there's anything else. @TheHydroImpulse and his windows batch file chops took care of the hard stuff (I mean wtf? lol). The rest is just making sure paths aren't using / but require('path').sep (which you have to escape for regular expressions, and gets a little messy). Cheers.

@thehydroimpulse

The latest pull request I submitted should fix one of the regular expressions on windows.

@lancejpollard

Can we close this?

@liferealized

Just tried to install tower on vanilla windows 7. After installing make for windows and running 'make install' i received this error.

****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******

@pashaie

@liferealized, I got same error when installing latest version (4.2-12)

After some investigation, I find out that make.bat file is calling itself on an infinite loop. make.bat#10
So, I commented out call %PPath% in make.bat to bypass that infinite loop.

But when I execute tower new app, it cause error which says ejs module not found.

------------ npm-debug.log

11588 info install tower@0.4.2-12
11589 info postinstall tower@0.4.2-12
11590 verbose unsafe-perm in lifecycle true
11591 silly exec cmd "/c" "make install-dependencies"
11592 silly cmd,/c,make install-dependencies,C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower spawning
11593 info tower@0.4.2-12 Failed to exec postinstall script
11594 info C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower unbuild
11595 verbose from cache C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower\package.json
11596 info preuninstall tower@0.4.2-12
11597 info uninstall tower@0.4.2-12
11598 verbose true,C:\Users\Pasha\AppData\Roaming\npm\node_modules,C:\Users\Pasha\AppData\Roaming\npm\node_modules unbuild tower@0.4.2-12
11599 verbose C:\Users\Pasha\AppData\Roaming\npm,[object Object] binRoot
11600 info postuninstall tower@0.4.2-12
11601 error tower@0.4.2-12 postinstall: make install-dependencies
11601 error cmd "/c" "make install-dependencies" failed with 255
11602 error Failed at the tower@0.4.2-12 postinstall script.
11602 error This is most likely a problem with the tower package,
11602 error not with npm itself.
11602 error Tell the author that this fails on your system:
11602 error make install-dependencies
11602 error You can get their info via:
11602 error npm owner ls tower
11602 error There is likely additional logging output above.
11603 error System Windows_NT 6.1.7601
11604 error command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "tower" "-g"
11605 error cwd D:\MyProgramming\js\brick
11606 error node -v v0.8.11
11607 error npm -v 1.1.62
11608 error code ELIFECYCLE
11609 verbose exit [ 1, true ]

--------- console error
****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******
npm ERR! tower@0.4.2-12 postinstall: make install-dependencies
npm ERR! cmd "/c" "make install-dependencies" failed with 255
npm ERR!
npm ERR! Failed at the tower@0.4.2-12 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make install-dependencies
npm ERR! You can get their info via:
npm ERR! npm owner ls tower
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "tower" "-g"
npm ERR! cwd D:\MyProgramming\js\brick
npm ERR! node -v v0.8.11
npm ERR! npm -v 1.1.62
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\MyProgramming\js\brick\npm-debug.log
npm ERR! not ok code 0

@edubkendo

@pashaie you can fix that with:

npm install -g ejs

This has something to do with your node environment, causing ejs not to get installed when the rest of tower's dependencies are.

EDIT: Actually, it looks like when you commented out that line in make.bat, that also comments out all the setup that file does, which includes installing tower's dependencies.

@pashaie

@edubkendo yeah, make file is supposed to call some command to take care of post-installation step. But instead, it's calling itself!

I installed ejs, but still got error:

events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: connect ETIMEDOUT
at errnoException (net.js:769:11)
at Object.afterConnect as oncomplete

@lancejpollard

@pashaie sorry you're running into this issue, we've been trying to get it working on all platforms and we're so close! I think this is the last issue, the BATCH RECURSION stuff.

The reason that's happening is because we added the ./make.bat file to the root of tower specifically to allow the windows cmd (which can't / doesn't have make from what I understand) to be able to execute that make install-dependencies command.

From what I understand about windows, there are two ways people use the command line (even though there are multiple shells on windows it seems):

  • The default cmd shell
  • The git bash shell

[Just rehashing to make sure I understand this correctly]. The git bash shell on windows seems to be the preferred (and better) shell, since it's more UNIX-like and it can install things like make. Is that roughly correct?

The thing is, Windows Azure uses the cmd shell, and from what I saw there's no way to install make. However, it is [probably] possible if you skip the simple heroku-like command-line interface to Azure, and just start managing the virtual machines directly; I'm sure you could install git bash and make if you went down that road (and if anyone does I'd love to learn how). That's way too much work though.

So instead of requiring all that work to get going on Azure I just wanted to get make working. So we added that ./make.bat and it works! This simple generated Tower app was deployed on Azure:

http://tower-azure-test.azurewebsites.net/

But now it seems that, at least on some windows, that make.bat script is causing this BATCH RECURSION issue since you probably already have the actual make installed. Do you know how to make the real make you may have installed on your windows to work alongside this make.bat script? It seems like it should be a straightforward fix but I don't know my way around windows/batch files very well

One solution - if there's no way to keep the make.bat and have it work alongside any real make that may be installed on windows - is to somehow remove it in an npm preinstall hook, but I'd like to avoid that if at all possible.

Any ideas? Looking forward to calling "windows support" done :)

@thehydroimpulse

@pashaie @liferealized What terminal are you guys using? (cmd, powershell, cygwin, or git bash?)

For starters make does not work on git bash even if you have the actual make installed. (at least in my case it doesn't. Possibly a git bash issue.)

Seems a little strange that some people can't get make.bat to work but others can. I'm running it perfectly fine with both make install and make.bat. Even all the commands such as make watch still work.

It might be an issue with which.bat or where. The bat file make.bat I made uses where, an actual windows default program. Try opening cmd and typing where make.

I've noticed that if you have ruby's devkit installed, it has it's own make program. I'm not sure if it's the same as others but it could be the culprit.

If you have the devkit installed, running .\where make (powershell), where make (cmd) you receive two locations both on separate lines.

C:\Users\Daniel\Documents\Projects\TowerSource>where make
C:\Users\Daniel\Documents\Projects\TowerSource\make.bat
C:\RailsInstaller\DevKit\bin\make.exe

The bat file make.bat will choose the first line it finds. So in this case it will run the make.bat. But if you run which.bat make, the results will be inverted and will run devkit's version.

Try running (inside the tower directory) where make and comment the result.
Try running (inside the tower directory) which.bat make and comment the result.
Finally, try editing the make.bat file and replacing the contents on line 10 with:

FOR /F "" %%i in ('which make') do SET PPath=%%i
@pashaie

@TheHydroImpulse I've tried cmd, powershell and gitshell. but steel same thing.
The result of make watch was:
INFO: Could not find files for the given pattern(s). '

I'll install ruby devkit and see what happens.

btw, @TheHydroImpulse and @viatropos thanks for your response. It's great to see such a wonderful support.

@thehydroimpulse

@pashaie No worries. Glad to be of assistance.

Did you try running: where make and which make? Try those and copy the results here, that will give quite a bit of info.

@pashaie

Adding devkit's bin to path, installation was successful. So, it's seems one must have devkit which is based on msys, before installing tower.

when using tower I got another error, which i suspect this issue isn't right place to report it, but just for the record :
after creating a new app, when running tower generate scaffold Post title:string body:text belongsTo:user I got

module.js:340
throw err;
^
Error: Cannot find module 'scripts\tower'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (C:\Users\pasha\AppData\Roaming\npm\node_modules\tower\bin\tower:8:3)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)

note that i'm running this command inside d:\myprogramming\js\app and there is a scripts\tower
Thank you guys.

@thehydroimpulse

That's a bit odd as not having any make programs in the path works on azure. I'll be sure to add that in the documentation; to add either devkit or windows make.

ahh yes that error is windows related. Are you running the latest Tower version (0.4.2-13)? I'm pretty sure my pull request (that was accepted yesterday) fixed that error but I'm not sure. Nevertheless I was able to fix that error. If not on the pull request then locally.

@lancejpollard

Just published 0.4.2-14 to npm, was only on GitHub. Glad to see the make stuff has a workaround.

So should we keep the make.bat? Is there no way to have it work on windows without first installing devkit or windows make? Either way having that info on the wiki will be great, thanks guys.

@thehydroimpulse

@viatropos I'm working on a much better bat file as there was the recursion problem when no make.exe was found.

Right now I've gotten an alternative to the makefile for all the installation stuff (node .\bin\install dependencies) but only outputs

npm install stylus uglify-js mocha chai sinon eco mustache jade kue mongodb coffeecup gzip chokidar knox socket.io socket.io-client fibers cli-table ttys cheerio colors mime async mint qs crc express URIjs moment node-uuid geolib validator accounting ember-metal-node ember-runtime-node ember-states-node coffee-script useragent gm temp connect fresh grunt-contrib-less

But never executes it. How did we fix this previously? I kinda forgot...

@haustraliaer

Just ran into the same problems that others are installing from the npm ... seems like you guys are working on this right now!

Here's my npm-debug.log results in case they help.

******  B A T C H   R E C U R S I O N  exceeds STACK limits ******
Recursion Count=703, Stack Usage=90 percent
******       B A T C H   PROCESSING IS   A B O R T E D      ******
npm ERR! tower@0.4.2-14 postinstall: `make post-install`
npm ERR! `cmd "/c" "make post-install"` failed with 255
npm ERR!
npm ERR! Failed at the tower@0.4.2-14 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make post-install
npm ERR! You can get their info via:
npm ERR!     npm owner ls tower
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\n
pm\\bin\\npm-cli.js" "install" "tower" "-g"
npm ERR! cwd C:\repos\towerjs
npm ERR! node -v v0.8.11
npm ERR! npm -v 1.1.62
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\repos\towerjs\npm-debug.log
npm ERR! not ok code 0

@thehydroimpulse

@haustraliaer I'll be submitting a pull request soon that will resolve this problem.

@thehydroimpulse

@viatropos nvm got it.

@thehydroimpulse thehydroimpulse referenced this issue from a commit in thehydroimpulse/tower
@thehydroimpulse thehydroimpulse Revamped make.bat as an alternative to Makefile
This also fixes issue #311 and allows users without make to run the more
popular commands in the Makefile such as: install, post-install,
install-dependencies, install-message, and watch.
e17bfb3
@lancejpollard

What's the status of this now, can we close?

@thehydroimpulse

It works for me on windows , not sure about anyone else.

@ginsent

Guys, let me reinstall clean node.js and do npm install tower -g and i'll give you what I get.

@lancejpollard

Thanks!

@ginsent

this is what I get after make:

Make cannot be found. Installing dependencies manually...
"/---------------------------------------------------------------------------\"
is not internal or external 
command, executable by program or batch file.
Unexpected apperance: |.
Unexpected apperance: |.    /* This is translated by me, ginsent, from Russian */
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
Непредвиденное появление: |.
"\---------------------------------------------------------------------------" 
is not internal or external 
command, executable by program or batch file.
tower@0.4.2-16 C:\Users\flyer\AppData\Roaming\npm\node_modules\tower
├── which@1.0.5
├── inflection@1.2.3
├── wrench@1.3.9
├── ansi@0.1.2
├── mime@1.2.7
├── node-uuid@1.3.3
├── underscore@1.4.2
├── underscore.string@2.3.0
├── commander@1.0.4 (keypress@0.1.0)
├── superagent@0.9.5 (methods@0.0.1, cookiejar@1.3.0, emitter-component@0.0.5, q
s@0.4.2, mime@1.2.5, formidable@1.0.9)
├── term-css@1.0.0 (css@1.0.1)
└── pathfinder@0.3.0-1 (async@0.1.22, mkdirp@0.3.4, mint@0.3.5, detective@0.2.1,
 findit@0.1.2)

C:\towertry>
@ginsent

and this I get having installed GnuWin32 Make

process_begin: CreateProcess(NULL, env node C:\Users\flyer\AppData\Roaming\npm\n
ode_modules\tower\bin\install dependencies, ...) failed.
process_begin: CreateProcess(NULL, env node C:\Users\flyer\AppData\Roaming\npm\n
ode_modules\tower\bin\install message, ...) failed.
make (e=2): Не удается найти указанный файл.
make: *** [install-message] Ошибка 2
tower@0.4.2-16 C:\Users\flyer\AppData\Roaming\npm\node_modules\tower
├── which@1.0.5
├── inflection@1.2.3
├── wrench@1.3.9
├── ansi@0.1.2
├── mime@1.2.7
├── node-uuid@1.3.3
├── underscore@1.4.2
├── underscore.string@2.3.0
├── superagent@0.9.5 (methods@0.0.1, cookiejar@1.3.0, emitter-component@0.0.5, m
ime@1.2.5, qs@0.4.2, formidable@1.0.9)
├── commander@1.0.4 (keypress@0.1.0)
├── term-css@1.0.0 (css@1.0.1)
└── pathfinder@0.3.0-1 (async@0.1.22, mkdirp@0.3.4, mint@0.3.5, detective@0.2.1,
 findit@0.1.2)

C:\Users\flyer>
@thehydroimpulse

The errors in the first post is probably because of the installation change after I had made the new make.bat but I'm not 100% sure. It does seem like something's outputting an acii table with instructions or help menus and it's trying to execute it. I'll take a look at it tomorrow sometime.

@ginsent Does everything else work?

  • Generating a new app?
  • Running cake watch?
  • Running node server?
  • Testing the demo app in the browser?
@ginsent

tower new app doesn't work

C:\towertry>tower new app

module.js:340
    throw err;
          ^
Error: Cannot find module 'ejs'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at GeneratorAppGenerator.Tower.GeneratorActions.render (C:\Users\flyer\AppDa
ta\Roaming\npm\node_modules\tower\lib\tower-generator\server\actions.js:197:12)
    at GeneratorAppGenerator.Tower.GeneratorActions.template (C:\Users\flyer\App
Data\Roaming\npm\node_modules\tower\lib\tower-generator\server\actions.js:190:17
)
    at GeneratorAppGenerator.<anonymous> (C:\Users\flyer\AppData\Roaming\npm\nod
e_modules\tower\lib\tower-generator\server\generators\tower\app\appGenerator.js:
61:14)
    at GeneratorAppGenerator.Tower.GeneratorActions.inside (C:\Users\flyer\AppDa
ta\Roaming\npm\node_modules\tower\lib\tower-generator\server\actions.js:166:11)
    at GeneratorAppGenerator.run (C:\Users\flyer\AppData\Roaming\npm\node_module
s\tower\lib\tower-generator\server\generators\tower\app\appGenerator.js:57:17)
    at C:\Users\flyer\AppData\Roaming\npm\node_modules\tower\lib\tower-generator
\server\generator.js:68:22

C:\towertry>

and I dont' have cake :(

@thehydroimpulse

You'll need to install ejs globally: npm install ejs -g.

Cake is a task or built tool that comes shipped with coffeescript. If you have coffeescript, you'll have cake: npm install coffeescript -g

That should take care of the errors. If you have any more module not found errors, try installing them manually with the -g flag.

@lancejpollard

Not sure why isn't ejs getting installed... It's declared in devDependencies:

package.json#L75

Do you have NODE_ENV set globally to production or anything like that? Or perhaps did you run npm install --production? Or maybe windows doesn't install devDepdendencies?

@lancejpollard

Really... lol, I didn't know that devDependencies don't get installed when you install a module globally. Will fix that right now.

@lancejpollard

Fixed the ejs issue, you shouldn't have to globally install it now.

@lancejpollard

@TheHydroImpulse unless you think it's reasonable/possible to get the makefile working on windows, we can instead just limit calling the make commands only to contributors who want to hack on the source (at least in the short term).

To do that I can merge localDependencies into dependencies, which will add all those modules to the global install which aren't really necessary, but it would get it working on windows I think. Then to get started hacking on the tower source, you'd have to run the make post-install manually.

I'd rather have this makefile thing working cross-platform but I don't want us to waste too much more time on it.

Also a good solution would be just to document the setup process for getting started on windows (such as "install make, install ruby dev-kit, etc" or whatever). As long as there's some way for windows users to get started I'd be happy with that in the short term.

@lancejpollard

The latest push to npm removes make from the npm install postinstall hook, so there's no dependency on make on npm install.

To hack on the tower source you'll have to run make install-dependencies after you clone the repo (added to the README). But just to use tower, you should be able to just run:

npm install tower -g
tower new app

I'd like to get put the make postinstall hook back in, but want to wait for a bit on it.

@lancejpollard

@ginsent if you try now what do you get? It should be v0.4.2-18.

@haustraliaer

ok just gave it a fresh install via npm install tower -g... seeing v0.4.2-18 as expected.

Following along here: http://towerjs.org/

I can get through tower new app fine. cd into the app..

Trying the next line though... tower generate scaffold Post title:string body:text belongsTo:user

Dumps me with the following:

module.js:340
    throw err;
          ^
Error: Cannot find module 'tower'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (C:\_repos\_tower\app\scripts\tower:3:1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)

Not sure if I'm meant to be able to do that yet - if it's part of the make file or anything?

Or do I need another dependency installed manually?

@thehydroimpulse

@haustraliaer FYI the towerjs website is outdated and may not work. Are you running the scaffolding command within a tower application? Sometimes it can be skipped to cd into the directory first. Also you would need to run npm install after you cd into your new app directory.

@lancejpollard

Looks like we're getting close :D

@thehydroimpulse

@viatropos I'll take a look at the make.bat file. If it works on multiple machines then we can put the postinstall back in. Is this the last thing until 0.4.3?

@lancejpollard

Yeah that's the last thing!

P.S. I'll update the site/workflow so we can keep the website roughly in sync with the wiki:

https://github.com/viatropos/towerjs.org/tree/master/public

Going to try and finish this today. Need some new design lol... Time for dribbble!

@ginsent

OMG, it worked all the way down to node server. Well, I still needed to delete folder node_modules and do npm install again, but it worked!!

@thehydroimpulse

@ginsent Nice! So everything works now?

@ricick

All seems to install correctly.

node init myapp works fine

npm install inside the project works but gives the following warning (not sure if this is a problem):

> iconv@1.2.3 install c:\Users\Phil\projects\towertest3\node_modules\nodemailer\
node_modules\mailcomposer\node_modules\mimelib\node_modules\encoding\node_module
s\iconv
> node-gyp rebuild


c:\Users\Phil\projects\towertest3\node_modules\nodemailer\node_modules\mailcompo
ser\node_modules\mimelib\node_modules\encoding\node_modules\iconv>node "c:\nodej
s\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js
" rebuild
c:\Users\Phil\projects\towertest3\node_modules\nodemailer\node_modules\mailcomp
oser\node_modules\mimelib\node_modules\encoding\node_modules\iconv\build\iconv.
vcxproj(1,680): error MSB4019: The imported project "c:\Microsoft.Cpp.Default.p
rops" was not found. Confirm that the path in the <Import> declaration is corre
ct, and that the file exists on disk.
gyp ERR! rebuild error Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msb
uild.exe` failed with exit code: 1
gyp ERR! rebuild error     at ChildProcess.onExit (c:\nodejs\node_modules\npm\no
de_modules\node-gyp\lib\build.js:214:23)
gyp ERR! rebuild error     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error     at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
[ws v0.4.22] Native code compile failed (but the module will still work):
[ws v0.4.22] The native extensions are faster, but not required.
[ws v0.4.22] On Windows, native extensions require Visual Studio and Python.
[ws v0.4.22] On Unix, native extensions require Python, make and a C++ compiler.

[ws v0.4.22] Start npm with --ws:verbose to show compilation output (if any).
npm WARN optional dep failed, continuing iconv@1.2.3

node server starts up and runs on 3000, but going to http://localhost:3000/ I get 404 errors for all the javascript and stylesheets etc

GET http://localhost:3000/stylesheets/vendor/stylesheets/bootstrap/bootstrap.css 404 (Not Found) localhost:12
GET http://localhost:3000/stylesheets/vendor/stylesheets/prettify.css 404 (Not Found) localhost:13
GET http://localhost:3000/stylesheets/app/stylesheets/client/application.css 404 (Not Found) localhost:14
GET http://localhost:3000/javascripts/vendor/javascripts/underscore.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/underscore.string.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/moment.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/geolib.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/validator.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/accounting.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/inflection.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/async.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/socket.io.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/handlebars.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/ember.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/jstorage.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/tower.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/bootstrap/bootstrap-dropdown.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/mocha.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/vendor/javascripts/chai.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/test/client.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/config/shared/application.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/config/client/bootstrap.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/config/client/watch.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/config/shared/routes.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/templates.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/controllers/client/applicationController.js 404 (Not Found) localhost:18
GET http://localhost:3000/javascripts/app/views/client/layout/application.js 404 (Not Found) localhost:18
Uncaught ReferenceError: App is not defined localhost:100

Those paths look wrong. javascripts/vendor/javascripts/ i'm guessing is meant to be just javascripts/. Any ideas?

@ricick ricick closed this
@ricick ricick reopened this
@ricick

oops didnt mean to close sorry

@lancejpollard

Looks like you're good to go, did you start the cake watch command? I think the assets just need to be compiled.

You'll have two windows, one running the server and one compiling/processing files when they change:

# first window
tower new app
cd app
npm install
tower generate scaffold post title:string body:text
node server
# second window
cd app
cake watch # or, if that fails which it shouldn't anymore, `grunt start --config grunt.coffee`

Alternatively, you can compile the assets on a one-off basis by running cake build instead of cake watch.

Does that solve it @ricick?

@thehydroimpulse

The paths seem right. If you take a look at public/javascripts you'll see a vender folder and within that, you'll see another javascripts folder.

Did you run cake watch before running the server? It happened a few times to me.

And that error isn't an issue just a warning that you won't get the native (C / C++) module version. Instead you'll get the Javascript that is completely functional. The difference is just speed as stated in the message. If you want it to install the native modules, you'll need python, and Visual C++ 2010 (Though the 2012, renamed from 2011 beta, has the ability to use the 2010 compiler and features but it may not work correctly.).

@thehydroimpulse

I guess @viatropos beat me to it! lol

@ricick

Woohoo! all working. Excellent work guys!

@ricick ricick closed this
@lancejpollard

Awesome!!

@lancejpollard

@TheHydroImpulse I'm going to bump 0.4.2-20 to 0.4.3 without the make.bat fix, unless you want to squeeze that in there (not necessary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.