stephenlb / nodejuice

Automatic browser refresh on file change or update is what you can call it. NodeJuice is a set of tools which allows you to develop with a push connection to your web browser. JavaScript V8 Seeker Server and Web Server Gateway Interface. nodeJuice Seeker Server works with all other servers including Apache, Passenger, Nginx, Cherokee, and more. A web server isn't required, NodeJuice comes with one in case you forgot yours. It runs on NodeJS; a low level non-blocking network ready process with many capabilities. This is a tool that every web developer needs and has wanted for a very long time. IRC @ #node.js
http://nodejuice.com
Other
78 stars 3 forks source link

The 'posix' module has been renamed to 'fs' #1

Closed ontoworks closed 14 years ago

ontoworks commented 14 years ago

hello, i am new to node and craving for having nodejuice to work

I'm seeing this error message when trying to run as WSGI

$ ./nodejuice

Error: The 'posix' module has been renamed to 'fs' at Object. (posix:1:69) at Module._compile (node.js:721:23) at loadNative (node.js:84:13) at loadModule (node.js:554:22) at require (node.js:700:12) at Object. (/home/santiago/Projects/third/nodejs/nodejuice/servers/wsgi.js:2:16) at Module._compile (node.js:721:23) at node.js:749:20 at fs:51:23 at node.js:810:9 Error: The 'posix' module has been renamed to 'fs' at Object. (posix:1:69) at Module._compile (node.js:721:23) at loadNative (node.js:84:13) at loadModule (node.js:554:22) at require (node.js:700:12) at Object. (/home/santiago/Projects/third/nodejs/nodejuice/library/utility.js:1:78) at Module._compile (node.js:721:23) at Module._loadScriptSync (node.js:733:16) at Module.loadSync (node.js:632:10) at loadModule (node.js:577:16)

is it maybe related to this post? ... http://groups.google.com/group/nodejs/browse_thread/thread/97e0057fc59eeb08)?pli=1

stephenlb commented 14 years ago

Yes NodeJuice is not synced with the last release of Node. Currently you'll need a separate build of Node in your NodeJuice Directory in order to make nodejuice run correctly. I'll be updating to node 0.1.32 or 0.1.33 in a few weeks. For now go to:

http://nodejuice.com/install

Download 0.1.27 and build with this version.

ontoworks commented 14 years ago

ok, i made changes for having it working with latest node version, and it starts ok but changes are not seen in browsers.

starting the service outputs ... $ ./nodejuice demos/rad deprecation warning: process.mixin will be removed from node-core future releases. deprecation warning: process.mixin will be removed from node-core future releases.

WSGI Server(14279)

Seeker Server(14278) { host: null , port: 8080 , root: "index.htm" , retry: { max: 4 , wait: 120 } , url: [[null , "/static/" ] , [null , "/app/rad.js" ]] } { host: null , port: 8002 , wait: 1200 , ignore: [null , null , null , null , null] }

when calling localhost:8080 it shows .... { code: 200 , type: "text/html" , uri: "/" , time: "Sat Mar 20 2010 17:47:38 GMT-0500 (COT)" , remote: "127.0.0.1" } { code: 200 , type: "text/html" , uri: "/favicon.ico" , time: "Sat Mar 20 2010 17:47:38 GMT-0500 (COT)" , remote: "127.0.0.1" }

when saving template.htm it shows ... { detected_touch: "/home/santiago/Projects/third/nodejs/nodejuice/demos/rad/static" } { detected_write: "/home/santiago/Projects/third/nodejs/nodejuice/demos/rad/static" } { detected_touch: "/home/santiago/Projects/third/nodejs/nodejuice/demos/rad/static/template.htm" } { detected_write: "/home/santiago/Projects/third/nodejs/nodejuice/demos/rad/static/template.htm" }

calling localhost:8002 shows the expected JS code

however file update is not seen in browser, what may be going on? any suggestions about what parts of the code to check ?

stephenlb commented 14 years ago

ontoworks, wow. that is cool you got it almost working with the latest node! there are a lot of legacy functions in NodeJuice which fixed missing components in older version of node. With the latest node, these special legacy functions are not needed.

So are you using the Sidekick interface or WSGI? With Sidekick, you can use any web server and language like Apache and Ruby or Nginx and Python.

santiago commented 14 years ago

hello, i am the same ontoworks. at http://github.com/santiago/nodejuice-patched is the code working with NodeJS 1.4.1. Old code is kept commented. files changed:

the changes i made get it working as described in my last post as ontoworks, however as mentioned there, when i save the file i changes are not seen in the browsers. i am using WSGI, what may be going on?

stephenlb commented 14 years ago

do you notice a in your html output in the browser? Again, there are a lot of legacy functions that need to be pruned before NodeJuice will work on newer versions of Node. If you want to get this working quickly, download node 0.1.27 and run with sidekick server or WSGI. I use this at work every day and it works great.

stephenlb commented 14 years ago

the fist sentence above was stripped by git hub. it should have been: "do you notice a <script scr="http://localhost:8002/"&gt; tag in your html output in the browser?"

rdzah commented 14 years ago

Hello, i have independently forward ported to the latest node api as well (no promises, posix = fs, etc), but unfortunately have the same issues as ontoworks & santiago - updates i make only show up with a page refresh, no realtime push. I do see the tag you refer to in my page html, right at the top, but with a script body of "Failed to load source for: http://localhost:8002".

stephenlb commented 14 years ago

rdzah,

Right. This is related to the the core of NodeJuice's ability to read changes and detect server side errors. Porting the the latest version of node will be tricky and require a near rewrite. For now you'll want to stick with 0.1.27 for NodeJuice and then use the Sidekick option. Sidekick is easier to use and you can turn off auto page reload by removing the :8010 port number.

The present solution: 1.) keep 0.1.27 for NodeJuice 2.) use Sidekick --> cd stephenlb-nodejuice-####### && ./nodejuice /path/to/files sidekick 3.) use the latest version of node for your project from a separate build OR use a different web server like nginx or apache.

stephenlb commented 14 years ago

Well. Looks like I was wrong. It was much easier to port NodeJuice to Node 0.1.33 than I thought. The port + updates will be pushed this evening.

stephenlb commented 14 years ago

Pushed latest NodeJuice release with node 0.1.33+ releases. Feel free to checkout the latest code to receive NodeJuice performance boosts.

rdzah commented 14 years ago

It works, thank you! Hopefully node's api will settle down as commonjs solidifies.