Use nodeclipse plugin - node.js

I'm using nodeclipse plugin in eclipse to start working with nodejs and expressjs ,but when i create expressjs project and try run app.js file i get this error
/home/ali/node_modules/express/lib/express.js:99
throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
^
Error: Most middleware (like favicon) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/home/ali/node_modules/express/lib/express.js:99:13)
at Object.<anonymous> (/home/ali/node-WS/express01/app.js:18:16)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
How can i fix this problem?

This means You have to install module separately. Maybe you're using latest version of expressJS.
installing modules separately will solve your problem!

Related

error starting node discordjs, how i can start?

Good, I apologize for the inconvenience, I would like to know if this has happened to someone, I am trying to run a bot in Ubuntu 18, but it does not start, I already installed everything as in Windows but for Ubuntu clearly.
In windows, the same bot works, but when I try to start it in Ubuntu, it throws me this error, I have already installed a thousand things on the machine that literally nothing to do with it.
If someone could help me or allow me where to read, I would be infinitely grateful.
root#ns533280:/home/Discord/Test# node index.js
module.js:487
throw err;
^
Error: Cannot find module 'node:events'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/home/Discord/Test/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
root#ns533280:/home/Discord/Test# node -v
v8.0.0
root#ns533280:/home/Discord/Test# npm -v
5.0.0
How To Solve Error: Cannot find module 'node:events' Error?
To Solve Error:-
Cannot find module 'node:events' Error Minimum required nodejs version is v16.6 in order to use discord.js. So You just need to update nodejs to v16.6. And Your error will be solved.
You use too old version of node.js. According to this doc node 16.6.0 required. Just update your node.js version by install new or by nvm(for manage different node.js version on your PC).

which node.js is needed for Ionic V1.4.3

I want to use Ionic V1.X, since I want to use AngularJS with .js support, instead of Angular with .ts support.
But when I try to run "ionic -v" to see my ionic version it prints out:
ReferenceError: primordials is not defined
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (C:\Users\tubes\AppData\Roaming\npm\node_modules\ionic\node_modules\vinyl-fs\node_modules
aceful-fs\graceful-fs.js:3:27)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
I deinstalled my previous ionic version to reinstall the old one.
I saw online that I could need an older node.js version, but I cannot find which one is needed.
my actual node.js is v12.19.0
Ok, I tried out different node.js
node.js V.6.12.3 seems to work, for anyone who might encounter the same problem

Issue with gulp trying to run an example - 'The super constructor to `inherits` must not be null or undefined.'

I'm trying to run an example, but I'm getting the following error when I try to gulp. I'm pretty new to node, so any direction or help would be very appreciated. The install went without any issues, seemingly.
$ nvm exec 4.2.2 gulp
Running node v4.2.2 (npm v2.14.7)
util.js:756
throw new TypeError('The super constructor to `inherits` must not ' +
^
TypeError: The super constructor to `inherits` must not be null or undefined.
at Object.exports.inherits (util.js:756:11)
at Object.<anonymous> ([working directory path]/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy/index.js:108:17)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> ([working directory path]/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy.js:4:17)
at Module._compile (module.js:435:26)
It seems this issue has come up in different contexts before but was unanswered:
1) Mean.io application is throwing error with forever
2) https://github.com/rajaraodv/rabbitpubsub/issues/4
Seems to be a fairly recent issue and it seems to not have to do with http-proxy.
Turned out to be a problem with an older version of browser-sync. Once that was updated, this started to work.
Try an older version of Node. The example's package.json specifies Node 0.10 in the engines section, which suggests the initial code may have been written for that version.

Cannot find module 'express-session'

I am trying to run sparkleshare-dashboard. This is an open source project you can see it here
https://github.com/tommyd3mdi/sparkleshare-dashboard.
The project use Node.JS and Redis and i have no experience with both. I did setup the environment as described in the help file and then i try to run file app.js from command line using 'node' command but i got this error.
Error: Cannot find module 'express-session'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (E:\Imports\sparkleshare-dashboard\app.js:5:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Maybe i didn't provide enough information but i am expecting that may be some of you guys has done some work on sparkleshare project and may someone can help me in this.
The reason is likely your ">" operator for express in the package.json.
Express 4.0 is out now and the complete middleware concept changed.
You need to install these middlewares manually.
"express-session" is one of the 4.0 middlewares.
I recommend to read
http://scotch.io/bar-talk/expressjs-4-0-new-features-and-upgrading-from-3-0
and
https://github.com/visionmedia/express/wiki/Migrating-from-3.x-to-4.x
Additionally some users were confused that the github repo is named just "session" but
npm install express-session
is correct.
Make sure you have installed express-session. You can check for the directory inside your node_modules folder or you can also chekc your dependencies inside your package.json file

Require cannot find custom module after moving to server

I am trying to deploy a node app that runs fine on my local Mac Lion, however. On the virtual Ubuntu box, it is giving an error:
module.js:340
throw err;
^
Error: Cannot find module '../lib/review'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/websites/Node_apps/min-driver-node/routes/reviews.js:2:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
There is my own custom modules in ./lib folder that are 'require' from the routes as following:
var Review = require('../lib/review');
What have I tried?
Ensured the same Node.js version running via
nvm(https://github.com/creationix/nvm)
Removed node_modules just to
re-install them by running "npm install"
Why is the 'require' unable import the custom modules from 'lib' folder on Server while works on Mac? Thank You
Try using the complete path to the file instead of using the relative path (../).
It looks like the 'require' module is case sensitive on Ubuntu but not on Mac....all my modules in lib folder starts with upper case(i.e. lib/Review.js), but when required in other parts of the code, it is lower case - require('../lib/review'). This is causing issue on Ubuntu but not on Mac lion. By updating the code to 'require('../lib/Review'), solves the problem
Is this a bug and i should be reporting this?
Try set file permissions chmod -R 744 '../lib/review'

Resources