Re: [nodejs] require is not defined in node.js 14.4.0

2020-06-07 Thread John Shaver
In an .mjs file, you do not use require. You use import. Try: import fs from "fs"; More info: https://nodejs.org/api/esm.html -John On Sun, Jun 7, 2020, 9:33 AM Matthew Hamilton wrote: > node.js 14.4.0 macOS Catalina, Visual Studio Code debugging. Line 11 in my > app.mjs file is var FileSys

Re: [nodejs] module not found issue

2020-03-22 Thread John Shaver
For some reason, it seems that your /var/server/models/productModel.(mjs|js|json) file is not being found by your application. Make sure that it is in place on the server, and that it is spelled (and capitalized) correctly. -John On Fri, Mar 20, 2020 at 1:46 AM Salomon Thomas wrote: > > Hi, >

Re: [nodejs] Re: Reconnecting to tcp socket server after closing does not work on LAN using Nodejs

2018-04-30 Thread John Shaver
Hey Anders, On Sun, Apr 29, 2018, 2:16 PM Anders Thorsby wrote: > Client works as expected in NodeJS but in Electron it will not reconnect. > What version of node is being used in your electron app? John Shaver -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.gith

Re: [nodejs] exercise 2

2017-08-14 Thread John Shaver
You can use a for loop for this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/ Reference/Statements/for Use the initialization expression to set the index you want to start at (var i = 2) then test for the end of the array (i < process.argv.length) in the condition expression, incremen

Re: [nodejs] UDP Broadcast and multiple interfaces

2016-09-23 Thread John Shaver
interfaces, you could create a new server for each address to call bind on. Maybe I'm completely off base, there. Hope it helps. -John Shaver On Tue, Sep 20, 2016 at 8:48 AM, Paul J R wrote: > Hi All, > > For the last couple of days i've been attempting to implement a DHCP ser

Re: [nodejs] variable scope in for loops

2015-05-23 Thread John Shaver
Hey Marc, Generate is not an array, but an object (which can be used as a key/value store). There are a couple of possible problems, assigning to the object instead of a property on the object, or assigning everything with the same key. Unfortunately, without more code (like the code that assig

Re: [nodejs] Need help understanding requiring modules.

2015-05-14 Thread John Shaver
This all seems good... It should be able to find the module where it is. What command are you using to run your script and where are you invoking it from? -John On May 13, 2015 11:55 AM, "Michael Deremer" wrote: > I have nodejs installed on a debian distro on my raspberry pi. I have > installed

Re: [nodejs] Node JS in a virtual environment?

2014-12-12 Thread John Shaver
On Dec 12, 2014 5:04 PM, "Sachinthya Wagaarachchi" wrote: > > I am starting to learn Node and MEANJS at the same time, and want to have a development folder that is independent. I don't know how to go about it... I have used Mongo and AngulaJS with Pyramid. Here's what I think I want. (Using linux

Re: [nodejs] Learnyounode "Make It Modular" does not pass

2014-11-07 Thread John Shaver
What you have there looks correct to me, as far as the module. Did you write the script that accepts the command line parameters, requires the module and then passes the parameters into the module? >From the lesson description: This problem is the same as the previous but introduces the conc

Re: [nodejs] Re: Problems running node/karma/phantomjs on Linux VM after getting it working on Windows/Cygwin

2014-10-30 Thread John Shaver
On Thu, Oct 30, 2014 at 3:37 AM, Floby wrote: > For example, Karma uses PhantomJS which is a binary executable (not > portable) and also uses socket.io which in turn uses ws which uses a > compiled addon (not portable). That would be a problem too. I wasn't actually using/installing the modules

Re: [nodejs] Problems running node/karma/phantomjs on Linux VM after getting it working on Windows/Cygwin

2014-10-30 Thread John Shaver
One problem I've seen with node running in a linux vm off of the host filesystem is that VirtualBox (and probably most virtualization software) disables symlinks on the shared filesystem for security reasons. npm uses symlinks when installing(probably to prevent duplicating files of the same modul

Re: [nodejs] eBay/PayPal Hackathon for NPO's

2014-10-08 Thread John Shaver
Just a heads up, people may have missed this. Gmail labeled it as a phishing email and spammed it. -John On Oct 8, 2014 11:21 AM, "Arun Chandrasekaran" wrote: > eBay/PayPal is organizing a hackathon at Austin on October on 18-19 and > would love to have students and folks from other companies i