Please verify that the package.json has a valid "main" entry, on running "npm start"

Expected behavior

Running “npm start” should start my admin panel seamlessly.

Actual behavior

Npm throws an error saying there is no valid entry

Failure Logs

Error: Cannot find module 'C:\Users\user\Desktop\projectName\node_modules\forest-express-mongoose\dist\index.js'. Please verify that the package.json has a valid "main" entry at tryPackage (internal/modules/cjs/loader.js:319:19) at Function.Module._findPath (internal/modules/cjs/loader.js:676:18) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:939:27) at Function.Module._load (internal/modules/cjs/loader.js:835:27) at Module.require (internal/modules/cjs/loader.js:1012:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (C:\Users\user\Desktop\projectNameapp.js:12:5) at Module._compile (internal/modules/cjs/loader.js:1123:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10) at Module.load (internal/modules/cjs/loader.js:972:32) { code: 'MODULE_NOT_FOUND', path: 'C:\\Users\\user\\Desktop\\projectName\\node_modules\\forest-express-mongoose\\package.json', requestPath: 'forest-express-mongoose' }

Context

Running the latest version of lumber. Using mlab for my database. The connection setup works fine. Just that “npm start” is failing.

Please provide any relevant information about your setup.

  • Package Version: 6.0.0 (forest-express-mongoose)
  • Express Version: 4.16.3
  • Database Dialect:
  • Database Version:mongod version: 3.6.12 (MMAPv1)
1 Like

Stupid question - you did run npm install right? Did it have any errors?
Does the folder \node_modules\forest-express-mongoose\ exist?

1 Like

Yes I did. And yes, of course it does.

Edit: I’ve used Forest Admin successfully for a project before and it’s on production. I just want to ensure nothing’s broken on the latest build.

So are you using v6.0.0? since the latest is v6.1.3 … which exact package did you install?

1 Like

The lumber script generated a package.json which has v6.0.0. So yeah, it’s not v6.1.3.

Edit: How about you give it a shot? I think the error might be reproducible with the latest version of lumber-cli

I have been able to reproduce the same error with the latest version of the lumber-cli package with a local MongoDB database.

  1. Lumber generate :white_check_mark:
  2. npm start :x:

Our team is currently working on this issue. Thanks for spotting this!

2 Likes

Hi @Solias99,

The problem you were facing should be fixed by now :white_check_mark: .
You can either:

  • On your existing project upgrade your forest-express-mongoose / forest-express-sequelize dependency to its latest version,
  • Or generate another project from scratch (with lumber generate).

Let me know if it works on your side.

Thanks a lot for bringing up this issue! :raised_hands:

2 Likes

Thanks for the timely help. Great stuff! Works now. If I do face any other issues, I’ll make sure I open another thread :slight_smile:

2 Likes