saschagehlich / hotnode Goto Github PK
View Code? Open in Web Editor NEWHot code loading for node.js
Home Page: http://www.filshmedia.net
Hot code loading for node.js
Home Page: http://www.filshmedia.net
I am new to node so please bear with me.
I did sudo npm install hotnode -g
.
I tried reinstalling it and still same issue.
So, the issue:
Whenever I run it, it does nothing. Even when I do hotnode -v
. I am not sure if this is me or not.
I'm doing all of this over ssh if that helps.
/usr/bin/hotnode --debug-brk=53626 http2.js
hotnode node process restarted
/usr/lib/node_modules/hotnode/javascript/hotloader.js:115
return self.stderrOutput(data.toString());
^
ReferenceError: self is not defined
at Socket.exports.HotLoader._Class.startProcess (/usr/lib/node_modules/hotnode/javascript/hotloader.js:115:14)
at Socket.EventEmitter.emit (events.js:96:17)
at Pipe.onread (net.js:396:14)
Any clue?
Thank you
Daniel
I have written a very simple hello world server.js file. After executing the command "hotnode server.js" from the command line, the server starts and I can access the app from a browser. However any subsequent changes to the server.js file does not restart hotnode automatically. I have to stop hotnode manually and restart it for the changes that I made to the server.js file to take effect. I also tried this with an absolute file path and had the same issue. I am running this environment on ubuntu linux 12.04 LTS. I don't have anything else to go on, since there are no error messages generated or anything else. It seems that hotnode simply does not recognize that the file has changed. Any thoughts on what could be going on?
for example:
I don't want to watch some directories or files, because i use some other tools to compile them
when i change these files, these files will be compiled to other files, then i see hotnode restart twice
once because original and the other once because compiled files
Deail info:
TypeError: util.print is not a function
at Socket. (C:\Users\xxxxxxxx\AppData\Roaming\npm\node_modules\hotnode\javascript\hotloader.js:112:19)
at Socket.emit (events.js:315:20)
replace the code "hotloader.js:112:19" with "console.log(data.toStirng()) " thre app running is OK
It gave this error:
$ hotcoffee app.coffee
hotnode: coffee process restarted
CreateProcessW: The system cannot find the file specified.
fs.js:734
throw new Error('use fs.watch api instead');
^
Error: use fs.watch api instead
at Object.watchFile (fs.js:734:11)
at Socket.<anonymous> (d:\users\Administrator\AppData\Roaming\npm\node_modules\hot
node\javascript\hotloader.js:81:28)
at Socket.emit (events.js:88:20)
at Pipe.onread (net.js:342:31)
hotnode index.js has been changed
hotnode node process restarted
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::8081
at Server.setupListenHandle [as _listen2] (net.js:1286:14)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at Function.listen (E:\testCode\ssr\node_modules_express@4.16.4@express\lib\application.js:618:24)
at Object. (E:\testCode\ssr\src\serve\index.js:31:8)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1313:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
I'm using [email protected] with [email protected] and [email protected] , when I typed hotcoffee src/startService.coffee
I got these:
$ hotcoffee src/startService.coffee
hotnode coffee process restarted
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn coffee ENOENT
at exports._errnoException (util.js:837:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)
at Function.Module.runMain (module.js:477:11)
at startup (node.js:117:18)
at node.js:951:3
I can't tell what happend via these error messages, please help, thx.
PS: when I typed coffee src/startService.coffee
everything goes well, but when the 'hot' is added before 'coffee' under the same directory the error above is thrown.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.