Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autogenerated app error #76

Open
tiberule opened this issue Jun 27, 2012 · 8 comments
Open

autogenerated app error #76

tiberule opened this issue Jun 27, 2012 · 8 comments
Assignees

Comments

@tiberule
Copy link

nodejs 0.6.19
after installation i did simple test
$ matador init tt1
$ cd !$ && npm install matador
$ cd all && node server.js

got bunch of errors

matador running on port 3000
soynode: Compile error
execvp(): No such file or directory

/srv/www/tt1/node_modules/matador/src/matador.js:431
throw err
^
Error: Error compiling templates
at ChildProcess. (/srv/www/tt1/node_modules/matador/node_modules/soynode/lib/soynode.js:177:18)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:362:16)
at Socket. (child_process.js:467:7)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:335:10)
at EventEmitter._tickCallback (node.js:190:38)

@ghost ghost assigned davidbyttow Jun 27, 2012
@davidbyttow
Copy link
Contributor

Seems to work for me with latest (1.1.5-beta):

$ matador init tt1
installing Matador into tt1
Success!
$ cd tt1
$ npm install matador

[email protected] ./node_modules/matador
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]
$ node server.js
matador running on port 3000

then was able to render both localhost:3000 and localhost:3000/soy

@dpup
Copy link
Contributor

dpup commented Jun 27, 2012

Thanks for the report. It'd be nice if this worked out of the box without having to do any configuration, so we'll look into it.

@davidbyttow
Copy link
Contributor

Note, I fixed this yesterday (or at least I thought it did). :-)

@dpup
Copy link
Contributor

dpup commented Jun 27, 2012

Heh, we replied at the same time. From the log it looks like the error is being thrown within the spawn command. Can't tell which directory doesn't exist. Probably inputDir.

@davidbyttow
Copy link
Contributor

From the steps above, I don't understand "cd all && node server.js". You want to run the server.js in the generated directory, right?

@tiberule
Copy link
Author

I did the same tests again.

$ node -v
v0.6.19

to be sure there will be fresh version
$ npm remove matador -g

$npm install -g matador
/usr/local/bin/matador -> /usr/local/lib/node_modules/matador/bin/matador.js
[email protected] /usr/local/lib/node_modules/matador
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected] ([email protected])
+-- [email protected]
L-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

$ matador init tt1
installing Matador into tt1
Success!

$ cd tt1
$ npm install matador
[email protected] ./node_modules/matador
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected] ([email protected])
L-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

/srv/www/tt1# node server.js

module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module '/srv/www/tt1/server.js'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)

As expected, because there is no server.js in tt1 dir

/srv/www/tt1# dir
all node_modules

so, I need to enter the 'all' dir to run the server

$ cd all
$ node server.js
matador running on port 3000
soynode: Compile error
execvp(): No such file or directory

/srv/www/tt1/node_modules/matador/src/matador.js:431
throw err
^
Error: Error compiling templates
at ChildProcess. (/srv/www/tt1/node_modules/matador/node_modules/soynode/lib/soynode.js:177:18)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:362:16)
at Socket. (child_process.js:467:7)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:335:10)
at EventEmitter._tickCallback (node.js:190:38)

@davidbyttow
Copy link
Contributor

Huh, interesting. I wonder why you're not getting a server.js. Might have to pull in some help on this one.

~/dev/scratch david$ node -v
v0.6.18

~/dev/scratch david$ sudo npm remove matador -g

~/dev/scratch david$ sudo npm install matador -g
/usr/local/bin/matador -> /usr/local/lib/node_modules/matador/bin/matador.js
[email protected] /usr/local/lib/node_modules/matador
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

~/dev/scratch david$ matador init tt1
installing Matador into tt1
Success!

~/dev/scratch david$ cd tt1

~/dev/scratch/tt1 david$ ls
app     server.js

~/dev/scratch/tt1 david$ npm install matador
[email protected] ./node_modules/matador
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

~/dev/scratch/tt1 david$ node server.js
matador running on port 3000

@tiberule
Copy link
Author

I think it's a system based problem.
on Debian 6 'matador init' command doesn't work as expected. it copies files from '/src/all/' to the new dir including 'all' subdir.
it's easy to fix it by adding '*' to cp command. here it is:
/bin/matador line 9

    exec('cp -R ' + __dirname + '/../src/all/* ' + path, function (err, out) {

now '$ matador init tt1' creates the app skeleton properly. But i'm not sure about the internal content.
Please upload somewhere the properly generated content, I'll try to diff it with my results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants