*solved* App crashes on NPM start. Atlas sees collections; Shell does not

SOLVED: my problem was I initially copied the contents of the mflix-js folder into a new mflix-js folder instead of copying the entire mflix-js folder that came zipped. This probably resulted in missing important hidden files.

Hi, I’m having trouble running this and none of the solutions in this forum worked for me. I made sure to follow the instructions correctly, I believe. Here is what I get when I run npm start :

> server@1.0.0 start /Users/diogo/Development/projects/mflix-js
> nodemon -L ./index.js

[nodemon] 1.17.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./index.js`
/Users/diogo/Development/projects/mflix-js/src/index.js:1
import app from "./server";
       ^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:760:23)
    at loader (/Users/diogo/Development/projects/mflix-js/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/diogo/Development/projects/mflix-js/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/Users/diogo/Development/projects/mflix-js/index.js:4:28)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
[nodemon] app crashed - waiting for file changes before starting...

Here is what I see when I try the Shell:

And finally here is what I see when using Atlas:

Some more details:
I am on MAC.

NPM version: 6.9.2
Node version: 11.14.0
MongoDB shell version v4.0.10

My .env file:

SECRET_KEY=secretpasswordformongouniversity
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-gmwpf.mongodb.net/test?retryWrites=true&w=majority
MFLIX_NS=sample_mflix
PORT=5000
1 Like

I have the same issue as you post.

What’s your solution?

My issue was I didn’t unzip the folder directly. I just copied the folder contents. It’s important to unzip the folder directly because it contains important hidden files. Hope this helps!

1 Like

ok…I did the same thing as you did… I copy the file into my repo, that’s why I was missing some . hidden files.

Thanks for help, it should solve my issue.

Did it solve the issue?