Loopback Node :- Error: Cannot find module ‘enum’

Published

I have searched a lot for the solution but not succeed

I Tried

   1.npm cache clean --force
   2.npm install 

And also tried with

    1. Manually remove cache files from C:UsersAppDataRoamingnpm-cache_logs
    2. npm install OR npm install enum

I am facing this issue while running my node server on a laptop

it’s showing an error in Console-like

 internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module 'enum'
Require stack:
- D:projectserverutilitiesNotificationManager.js
- D:projectservermodelsUserProjectAction.js
- D:projectnode_modulesloopback-bootlibrequire.js
- D:projectnode_modulesloopback-bootlibcompiler.js
- D:projectnode_modulesloopback-bootindex.js
- D:projectserverserver.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (D:projectserverutilitiesNotificationManager.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (D:projectservermodelsUserProjectAction.js:5:27)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:projectserverutilitiesNotificationManager.js',
    'D:projectservermodelsUserProjectAction.js',
    'D:projectnode_modulesloopback-bootlibrequire.js',
    'D:projectnode_modulesloopback-bootlibcompiler.js',
    'D:projectnode_modulesloopback-bootindex.js',
    'D:projectserverserver.js'
  ]
}

I am new in node js so not able to understand what exactly going wrong here.

Please help me to understand

Source: AngularJS Questions

Answers

I was facing similar kind of issue .And i resolved that by following these steps

1. Remove 'package-lock.json' file locally from your machine
2. 'run npm install' on project CMD command panel 

I hope this can help you to resolve this issue.


Krystel Johnston

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq