Node.js Mongodb - Kerberos module not found - javascript

Im trying to npm install mongodb.
It works and tells me that modules are installed, kerberos is in this list.
But when im trying to run my app i keep getting this:
Error: Cannot find module '../build/Release/kerberos' from '/Users/snorre edwin/Code/raspberry-node- server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/lib'
Error: Cannot find module '../../../build/Release/kerberos' from '/Users/snorre edwin/Code/raspberry-node-server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/lib/win32/wrappers'
Error: Cannot find module '../../../build/Release/kerberos' from '/Users/snorre edwin/Code/raspberry-node-server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/lib/win32/wrappers'
Error: Cannot find module '../../../build/Release/kerberos' from '/Users/snorre edwin/Code/raspberry-node-server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/lib/win32/wrappers'
Error: Cannot find module '../../../build/Release/kerberos' from '/Users/snorre edwin/Code/raspberry-node-server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/lib/win32/wrappers'
It doesnt make sense, since this is a module which comes with the mongodb package.
Anyone else experienced this?

A quick Google found this discussion thread: https://nodejstools.codeplex.com/workitem/532. Although it is in context of Microsoft VS.
Different, possible solutions include:
Instal mongoose (not mongo) globally using npm install mongoose -g.
So I fixed this issue by installing mongoose globally via NPM, then I copied the build folder in the mongoose/node_modules/mongodb/kerberos to my local mongoose folder in my VS project.
If you're using mongoose, the thread additionally suggests you'll need python installed.
Add kerberos to the package.json file itself. Also try to install globally.
Ignore it:

Related

A file called pty.node.js is missing after installing "node-pty" in a electron-forge project. How can I install node-pty in Linux

After installing node-pty (an external module used to create pseudo terminals using node js) in a boilerplate electron-forge project; I found it throwing an error that some core module of node-pty is importing another module which nodejs is failing to find.
After some research I discovered that entry point of node-pty is src/index.js, which imports another module called src/unixTerminal.js (this file is imported if the system is running on linux platform and my PC is running on Ubuntu 20.04) and that module tries to import build/Releases/pty.node.js (unixTerminal.js calls many functions imported from pty.node.js, so this package cannot be ommitted) but as a matter of fact build/Releases/pty.node.js is missing and completely absent in the node_modules/node-pty folder of my project where I had installed node-pty
Why does this happen? Is this any fault of myself in installing node-pty, I had installed it directly using npm i command? If a vital file of a module is missing how can it work? Please tell me how can I use node-pty on Linux and why build/Releases/pty.node.js is missing in node-pty's directory?
Since you're using Electron Forge (a crucial detail omitted from the original post), according to this issue I found by googling "node-pty electron forge" you'll need to configure the Electron packager to unpack the pty.node file:
asar: {
unpack: '**/node_modules/node-pty/build/Release/*'
},

How to use npm country codes

Hin I am new in node.js. I already created my project in cordova cross platform Mobile Application. Now I want to install npm country-codes package "https://www.npmjs.com/package/country-codes". I already install this from command line But I can't get country codes. It's display error
"Uncaught Error: Module name "countryCodes" has not been loaded yet for context: _. Use require([])
I don't konw how to solve it please help me.
I simple use this from npm doc. In my Project I used backbone.js and require.js
var countryCodes = require('countryCodes')
console.log(countryCodes)
Pay notice that this page module in NPM says the following:
This module is deprecated.
Please use the country-data package instead of this country-codes module. It is more well-maintained and the original author of this repository/package has decided to focus on that module instead. Here is a link to it: https://github.com/OpenBookPrices/country-data/. If you need help with a migration, please file an issue on that repository and tag #niftylettuce.
The second thing you need to do is to install it with npm command and it should appear under your node_modules folder
npm install country-codes
The error that you are experiencing is created by the common.js library which is the Node.js loader library.
This occurs when there is a require('name') call, but the 'name' module has not been loaded yet.

Meteor: "ReferenceError: module is not defined" after installing package

I created meteor package which contains ZiggeoSDK api to integrate ziggeo into my meteor app. After installing this package it is giving error:
ReferenceError: module is not defined
Ziggeo is Node Server SDK repository. And package contains ziggeo-sdk.min.js file.
Does anyone know how to resolve this issue.
Your problem is located at the line #11 in https://github.com/Ziggeo/ZiggeoNodeSdk/blob/master/ziggeo-sdk.js
This project uses Node.js modules. Check the require() functions too, they load other npm dependencies such as crypto or http.
You need to ask the owner for the npm package or create one yourself https://docs.npmjs.com/getting-started/creating-node-modules. Once the packages is ready, load it in Meteor using meteorhacks:npm.

Unable to use NPM package in Meteor.js

I installed both the meteor-npm package and the crypto npm package. After starting Meteor, the console outputs
npm: updating npm dependencies -- crypto
However when I tried using the npm package within the server:
var Crypto = Npm.require('crypto')
I get the error
Error: Cannot find module 'crypto'
Next I tried
var Crypto = Meteor.require('crypto')
and I get the error
Error: Cannot find module '/Users/athenawisdoms/app/.meteor/local/build/programs/server/npm/npm/main/node_modules/crypto'
I noticed the npm package is present at /packages/npm/.npm/package/node_modules/crypto and at /.meteor/local/build/programs/server/node_modules/npm/node_modules/crypto but not at /Users/athenawisdoms/app/.meteor/local/build/programs/server/npm/npm/main/node_modules/ as mentioned in the error message.
Did the installation go wrong?
I ran into this issue as well. I'm pretty sure this is a bug in the way Meteor interacts with NPM, and so I've created a replication of the problem and filed an issue. However, I soon realized that it was a red herring, as the package I was using actually wanted to use Node's crypto module and not the NPM one. Are you sure that this is not the case with your package as well?
I have a feeling this may be related to the fact that the doubly named crypto modules are probably trampling on each other.

error installing/running Meteor with MySQL

I have installed Meteorite on my mac, and am trying to run the test program provided as a mysql project. When I use the command 'mrt', I get:
Stand back while Meteorite does its thing
Done installing smart packages
Ok, everything's ready. Here comes Meteor!
[[[[[ /Users/lfrey/Desktop/Thesis/test-meteor-sql ]]]]]
=> Errors prevented startup:
While building the application:
node_modules/meteor/app/lib/unsupported.html:1: Can't set DOCTYPE here. (Meteor sets for you)
node_modules/meteor/app/meteor/meteor.js:1:15: Unexpected token ILLEGAL
=> Your application has errors. Waiting for file change.
I have tried re-installing nom, meteor, meteorite, and mysql in various combinations and have not been able to eliminate the error. If I remove the command, then I get an error about invalid HTML syntax.
Your app might not be created properly. You have a node_modules directory in your application which you might have added with npm install.
Meteor does not install modules with npm install manually, it doesn't work because it parses files in the node_moules directory as part of your meteor app (in the wrong way - not as an npm module).
You have to make sure the package you use uses Npm.depends in your package's package.js. The standard Meteor-SQL package already does this for you so you don't have to worry about it.
Which SQL package did you use? As far as I can see none of them install anything with npm install nor do they have instructions to.
The simple fix to get your app working is to remove the modules you installed by deleting the node_modules directory in your app.

Categories