2

I've followed the installation instructions for Tower.js, and am getting an error when I try to start the server.

TypeError: Cannot read property 'watchfile' of null

My steps for installing have been-

  1. Install node.js
  2. Install mongodb
  3. Install Ruby and Ruby dev kit.
  4. Install Tower.js-
sudo npm install design.io -g
npm install tower -g
  1. Generate app
tower new app
cd app
sudo npm install
tower generate scaffold Post title:string body:text
npm test
node server

I get an error on npm test-

> ./node_modules/mocha/bin/mocha $(find test -name "*Test.coffee")

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

Running node server, the server starts up, but gives continual errors

c:\Projects\MyProject\node_modules\design.io\lib\design.io\extensions\watchfile.js:7
    return project.createWatcher(project.watchfile, {
                                        ^
TypeError: Cannot read property 'watchfile' of null
    at Object.module.exports (c:\Projects\MyProject\node_modules\design.io\lib\design.io\extensions\watch
ile.js:7:41)
    at Object.module.exports.extension (c:\Projects\MyProject\node_modules\design.io\lib\design.io.js:11:
6)
    at Object.<anonymous> (.:14:22)
    at Module._compile (module.js:449:26)
    at Object.Project.read (c:\Projects\MyProject\node_modules\design.io\lib\design.io\project.js:168:22)
    at Object.module.exports.coffee (c:\Projects\MyProject\node_modules\mint\mint.js:187:18)
    at Project.read (c:\Projects\MyProject\node_modules\design.io\lib\design.io\project.js:167:21)
    at fs.readFile (fs.js:176:14)
    at fs.close (c:\Projects\MyProject\node_modules\design.io\node_modules\hook.io\node_modules\npm\node_
odules\graceful-fs\graceful-fs.js:94:5)
    at Object.oncomplete (fs.js:297:15)
Forever detected script exited with code: 1
Forever restarting script for 1 time

I am new to Node.js, and on Windows 7 64-bit. Any hints as to what could be causing this error?

Spongeboy
  • 2,232
  • 3
  • 28
  • 37
  • I don't know anything about windows 7, but it looks the first issue might be b/c relative path were written using unix syntax (the `./node_modules`, https://github.com/viatropos/tower/blob/master/package.json#L90, not sure about that though). Also, design.io doesn't yet have support for windows, so there is no listener class: https://github.com/viatropos/design.io/blob/master/src/design.io/listener/windows.coffee. Try commenting out the design.io watcher: https://github.com/viatropos/tower/blob/master/lib/tower/server/application.js#L212 (though that will probably cause other issues). – Lance Jul 18 '12 at 07:21
  • 3
    In short, tower doesn't have windows support (at least yet). – Lance Jul 18 '12 at 07:23
  • Hey Lance, I also crashed and burned trying to run Tower on both Win7 and Debian 6 a few weeks ago. Could you include some notes about platform support in the Tower readme? I suppose I could make a pull request, but I don't really know much about the underlying problems tbh... – newbyca Jul 18 '12 at 08:36
  • Thanks, I assumed it was a Windows issue. Tower looks like a nice framework, I'll try it out on Linux VM. – Spongeboy Jul 19 '12 at 00:27
  • For now, Tower only works on Mac and Ubuntu for sure. I personally have only tested it on a Mac and Heroku, but several others have been using it on Ubuntu with no problems. It should be just a couple little things here and there to get it working everywhere else, most of the code is platform independent (main issues are probably just with dependency versions and native libs they may install, or file system access, which only happens in a few spots). I'd love some help to get this working on the other platforms. Feel free to create pull requests and issues and I'll help with any questions. – Lance Jul 19 '12 at 10:14
  • 2
    Tower now has windows support (v0.4.1) – Lance Aug 24 '12 at 04:24

0 Answers0