ais-one/cookbook

Quick Start error: Cannot find module './firebase.key.json'

tmcmah1 opened this issue · 1 comments

Thank you for your hard work on this! I'm looking forward to trying it out.
Unfortunately when I follow the steps in the Quick Start, I'm getting an error.

The following steps appeared to complete successfully:

git clone https://github.com/ais-one/vue-crud-x.git
cd vue-crud-x
npm run install-libs
npm run install-db

But npm run dev fails with the following errors:

[nodemon] starting `node index.js`
example-app development
missing configuration file, using defaults Error: ENOENT: no such file or directory, open 'C:\dev\samples\vue-crud-x\example-app\config/.env.development'
TEST_ENV= undefined
internal/modules/cjs/loader.js:796
    throw err;
    ^

Error: Cannot find module './firebase.key.json'
Require stack:
- C:\dev\samples\vue-crud-x\example-app\config\index.js
- C:\dev\samples\vue-crud-x\common-app\config.js
- C:\dev\samples\vue-crud-x\app.js
- C:\dev\samples\vue-crud-x\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\dev\samples\vue-crud-x\example-app\config\index.js:7:22)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\dev\\samples\\vue-crud-x\\example-app\\config\\index.js',
    'C:\\dev\\samples\\vue-crud-x\\common-app\\config.js',
    'C:\\dev\\samples\\vue-crud-x\\app.js',
    'C:\\dev\\samples\\vue-crud-x\\index.js'
  ]
}

Appears to be coming from this line in 'example-app/config/index.js':

7 | const FIREBASE_KEY = require('./firebase.key.json') || ''

Hi,

I think it is fixed in develop branch, anyway for now you can do this...

const FIREBASE_KEY = false

however, if you are testing out file uploads to google, then need to have the google service account JSON file...

I am currently re-organizing the folders one more time to make it more CI/CD friendly...