I get this error:
ReferenceError: firebase is not defined
at Object. (/Users/jacob/node_modules/firebase/firebase.js:32:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/Users/jacob/nodetest/firebasetest.js:4:16)
at Module._compile (module.js:541:32)
when trying to require firebase with this single line of code:
var firebase = require("../node_modules/firebase/firebase")
according to https://firebase.google.com/docs/server/setup#add_firebase_to_your_app
any hints?
Related
I am accessing Cloud Pub/Sub API via #google-cloud/pubsub . But Iam getting Import . I have tried so many approaches which from stack over flow but nothing worked.
The Above Same functionality is working fine with local nodemodules .Why my lambda is not able to get those node modules .
module initialization error: Error
at Object.<anonymous> (/var/task/node_modules/google-gax/node_modules/#grpc/grpc-js/build/src/index.js:47:11)
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)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/task/node_modules/google-gax/build/src/grpc.js:37:14)
at Module._compile (module.js:652:30)
Was hoping to see if anyone knows why this error is occurring? I am trying to deploy an app to digital ocean and everything was going well until this.
emphasized text/home/user/koala/server/node_modules/knex/lib/knex.js:33
if (arguments.length === 0 || !config.client && !config.dialect) {
^
TypeError: Cannot read property 'client' of undefined
at Knex (/home/user/koala/server/node_modules/knex/lib/knex.js:33:41)
at Object.<anonymous> (/home/user/koala/server/db/connection.js:5:20)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/user/koala/server/components/account/accountController.js:1:82)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
[nodemon] app crashed - waiting for file changes before starting...
Error: Cannot find module '../build/Release/kerberos'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/mnt/c/Repo/firm-datahub-api/node_modules/authenticate-uxtf/node_modules/kerberos/lib/kerberos.js:1:16)
at Module._compile (module.js:653:30)
at Module._compile (/mnt/c/Repo/firm-datahub-api/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (module.js:664:10)
at Object.newLoader [as .js] (/mnt/c/Repo/firm-datahub-api/node_modules/pirates/lib/index.js:88:7)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/mnt/c/Repo/firm-datahub-api/node_modules/authenticate-uxtf/node_modules/kerberos/index.js:2:18)
at Module._compile (module.js:653:30)
at Module._compile (/mnt/c/Repo/firm-datahub-api/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (module.js:664:10)
at Object.newLoader [as .js] (/mnt/c/Repo/firm-datahub-api/node_modules/pirates/lib/index.js:88:7)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
I tried every available solution but getting same result.
I installed, kerberos server, client, workstation, what am I missing?
When I started app on windows I get this error:
Error: Module did not self-register.
at Object.Module._extensions..node (module.js:672:18)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\ahmet\node_modules\line-in\index.js:2:20)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
I updated all modules
I updated node
I do everything but still this error
I am trying to setup mocha to test an ExpressJs app.
When I run tests using npm test I got the following error:
TypeError: undefined is not a function
at Object.<anonymous> (/myapp/bin/www:11:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.cls_wrapMethod (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/newrelic/lib/shimmer.js:230:38)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/nathanzylbersztejn/git/airdesk-api/controllers/session.js:13:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.cls_wrapMethod (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/newrelic/lib/shimmer.js:230:38)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/nathanzylbersztejn/git/airdesk-api/app.js:10:25)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/nathanzylbersztejn/git/airdesk-api/test/test.js:5:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /Users/nathanzylbersztejn/git/airdesk-api/node_modules/mocha/lib/mocha.js:185:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/mocha/lib/mocha.js:182:14)
at Mocha.run (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/mocha/lib/mocha.js:394:31)
at loadAndRun (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/mocha/bin/_mocha:349:22)
at Object.<anonymous> (/Users/nathanzylbersztejn/git/airdesk-api/node_modules/mocha/bin/_mocha:366:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Where /myapp/bin/www:11:5 refers to the following line:
var app = require('../app')
app.set('port', process.env.PORT || 3000); // <- this line
^
The app works well, so it's not related to the app setup.
Any idea?
First guess is you have a circular dependency, which node handles by returning an empty object until the circle is finished. Do you do something like require("./bin/www"); inside app.js?
If you post app.js and bin/www we should be able to confirm.
Second guess is app.js just isn't getting the commonjs exports correct.
I'm also pretty sure you should be able to test your express app with supertest loading just app.js and leaving bin/www just for when you launch a real server instance.