JonAbrams / synth

The first back-end framework specially designed for single-page web applications
http://www.synthjs.com
MIT License
969 stars 70 forks source link

Synth was broken when I create a new project or auto restarting server #82

Open PeachScript opened 9 years ago

PeachScript commented 9 years ago

The Synth running well some day ago, but it has some problem after I update the node.

When I start a server by synth server -p 5004 and modify a watching file and refresh the browser, synth give me the following exception:

A file was changed, restarting server
/usr/local/lib/node_modules/synth/lib/commands.js:30
    } else throw err;
                 ^
Error: Module did not self-register.
  at Error (native)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at requireBinding (/Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/node_modules/node-sass/sass.js:17:14)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/node_modules/node-sass/sass.js:24:15)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/lib/stylesheet/processors/scss.js:1:74)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at /Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/lib/stylesheet/index.js:19:28
  at Array.forEach (native)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/lib/stylesheet/index.js:18:27)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/node_modules/harp/node_modules/terraform/lib/terraform.js:3:19)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/node_modules/harp/lib/index.js:3:19)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/some_dir/back/node_modules/synth/synth.js:7:12)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/some_dir/back/back-app.js:1:75)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (/Users/some_dir/back/node_modules/synth/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at requireUncached (/usr/local/lib/node_modules/synth/lib/requireUncached.js:18:10)
  at loadApp (/usr/local/lib/node_modules/synth/lib/commands.js:25:12)
  at startServer (/usr/local/lib/node_modules/synth/lib/commands.js:100:15)
  at Server.<anonymous> (/usr/local/lib/node_modules/synth/lib/commands.js:93:7)
  at Server.g (events.js:199:16)
  at Server.emit (events.js:104:17)
  at net.js:1392:10
  at process._tickCallback (node.js:355:11)

I try to reinstall the nodeJS and the synth, but got seem error. Then I doubt the problem be cause by me, so I decided create a new project and init it to detect the problem, but I found another problem.

I got three broken JSON file after create the new project:

synth.json:

function (obj) {
obj || (obj = {});
var __t, __p = '';
with (obj) {
__p += '{\n  "name": "' +
((__t = ( appName )) == null ? '' : __t) +
'",\n  "version": "0.0.1"\n}\n';

}
return __p
}

package.json:

function (obj) {
obj || (obj = {});
var __t, __p = '';
with (obj) {
__p += '{\n  "name": "' +
((__t = ( appName )) == null ? '' : __t) +
'",\n  "version": "0.0.1",\n  "dependencies": {\n    "synth": "^' +
((__t = ( synthVersion )) == null ? '' : __t) +
'",\n    "promised-mongo": "^0.11",\n    "bluebird": "^1.0.3",\n    "body-parser": "^1.6.3",\n    "lodash": "^2.4.0"\n  },\n  "devDependencies": {\n  }\n}\n';

}
return __p
}

bower.json:

function (obj) {
obj || (obj = {});
var __t, __p = '';
with (obj) {
__p += '{\n  "name": "' +
((__t = ( appName )) == null ? '' : __t) +
'",\n  "private": true,\n  "dependencies": {\n    "angular": "1.x",\n    "angular-route": "1.x"\n  }\n}\n';

}
return __p
}

How can I fix the problem? Thank you very much! :D

PeachScript commented 9 years ago

I found the cause of the second problem, and I create a new pull request in https://github.com/JonAbrams/synth/pull/83

JonAbrams commented 9 years ago

Which version of Node did you upgrade to?

PeachScript commented 9 years ago

Node: v 0.12.0 NPM: v 2.5.1 node-gyp: v 1.0.2

JonAbrams commented 9 years ago

I guess fixes are needed to make it work with Node 0.12 :-|

Thanks for the report!

On Tue, Mar 10, 2015 at 11:06 PM, XiaoShengtao notifications@github.com wrote:

Node: v 0.12.0 NPM: v 2.5.1

node-gyp: v 1.0.2

Reply to this email directly or view it on GitHub: https://github.com/JonAbrams/synth/issues/82#issuecomment-78210317

PeachScript commented 9 years ago

You're welcome, thanks for you create the Synth :D.

Maybe I need reinstall the Node 0.11 or you will fix it quickly?

JonAbrams commented 9 years ago

It’ll probably take a while to fix, you’re best off rolling back Node versions, sorry :(

On Tue, Mar 10, 2015 at 11:13 PM, XiaoShengtao notifications@github.com wrote:

You're welcome, thanks for you create the Synth :D.

Maybe I need reinstall the Node 0.11 or you will fix it quickly?

Reply to this email directly or view it on GitHub: https://github.com/JonAbrams/synth/issues/82#issuecomment-78210906

PeachScript commented 9 years ago

Never mind, keep in touch :)