node js express not able to resolve node modules/merge-descriptors - node.js

I have a simple node.js express application.
When I run npm run serve, I am getting below error.
In my node_modules folders I can see merge-descriptors folder, but when I try to start express server, looks like it is complaining about not able to find the component.
My path correctly has node_modules/.bin set.
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'merge-descriptors'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/tmp/site/node_modules/express/lib/express.js:16:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Related

Can't deploy my node.js app anymore on ubuntu

An old app at work stoped working on an aws machine. I've been assigned the task, but I'm more of a Rails guy. And this is node.js using an old Sails. I tried a bunch of stuff and now even my npm seem broken. I get this error:
ubuntu#ip-172-31-5-52:~$ npm -v
internal/modules/cjs/loader.js:605
throw err;
^
Error: Cannot find module 'are-we-there-yet'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:659:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:2:16)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)

Cannot find module 'generator-jhipster'

I am trying to load the "generator-jhipster' inside Yeoman as is described on the Yeoman documentation:
http://yeoman.io/authoring/integrating-yeoman.html
var yeoman = require('yeoman-environment');
env.register(require.resolve('generator-jhipster'), 'jhipster:app');
The "generator-jhipster' and "generator-jhipster-entity-audit" modules are installed in node and in the app, in fact, I can use the "generator-jhipster" from the "yo "command without problems, but when I run my node Script, it give me the error:
module.js:549
throw err;
^
Error: Cannot find module 'generator-jhipster'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\DANI\Randoop\JHIPSTER\server.js:6:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Any idea about how to solve this error?
Solved.
The jHipster genetator don't have the index.js on the main folder, so, the correct code to invoke it is:
var yeoman = require('yeoman-environment');
var env = yeoman.createEnv();
env.register(require.resolve('generator-jhipster/generators/app'), 'jhipster:app');

Error: Cannot find module 'internal/linkedlist' in WebStorm

I have a script that runs fine when I run it in terminal with node, but using WebStorm I can't properly run it as it crashes on a dependency require line.
I've attempted to npm install internal/linkedList, I've also attempted to npm cache clean (as recommended in another post).
The full stack trace is:
Error: Cannot find module 'internal/linkedlist'
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> (/Users/harshagoli/Library/Preferences/WebStorm2017.2/javascript/nodejs/8.1.4/core-modules/timers.js:26:11)
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)

Cannot run express-spdy app using NodeJS

I'm not able to run NodeJS Express-Spdy examples downloaded from GitHub.
I'm getting the below error:
C:\Program Files\nodejs\node_modules\npm\node_modules\express-spdy>node app.js
module.js:340
throw err;
^
Error: Cannot find module 'express-spdy'
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> (C:\Program Files\nodejs\node_modules\npm\node_modules\express- spdy\app.js:6: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)
Please tell me how to resolve this error, as I have put express-spdy inside node_modules folder.
When I run the example using SPDY module only by placing it inside node_modules it works fine but with express-spdy module it shows above error.

OData, JayData, and node.js: Cannot find ExpressionVisitor.js

I ran npm install odata-server, but calling require('odata-server') fails with the following:
Using JayLint for code parsing
module.js:340
throw err;
^
Error: Cannot find module './Types/Expressions/Visitors/ExpressionVisitor.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/anewman/node_modules/odata-server/lib/jaydata/lib/index.js:28:1)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
Try to reinstall the module and check that the missing file is there. Please also check your NODE_PATH settings because the library can not find the acorn parser module under ~/node_modules/odata-server/lib/jaydata/node-modules/acorn

Resources