Electron cannot find module mysql - mysql

So i've been creating a desktop application using electron. The problem is that when I run my application using npm it doesn't show any error about a missing module but when i package it and run it this error shows
I'm sure that i've install mysql module using npm install -g mysql and npm install mysql in the project directory. It's all working fine when i run the unpacked version of the application

Assuming that you have installed mysql if not please install mysql npm install mysql --save-dev
Hi I also ran in same error I tried everything possible but nothing seems to work , after several hit and trial I was able to fix it and in the end realize that it was all happening because of
When I installed MySQL module I never saved it (--save-dev)
And electron-packager was not able to locate it when I pack it because was not mention in package.json
A solution might locate mysql folder in node_module folder and delete
then install it npm install mysql --save-dev
or manually
add it under dependencies in package.json file

Related

package.json Not Found after using npm audit fix

I am trying to install sass and I don't understand why I keep running into the issue shown below
I understand I should follow the instructions and run npm audit fix but when I run the command, I get an error of no package.json found, and yes, that is so because sass wasn't installed at all and thus no node-modules and the json file, how do I fix this issue?
Try running the npm init command at the root of your project to generate the package.json file and re run the command to install sass.

Meteor: unable to install mysql in my meteor app

I have cloned one of my local project to another folder. I faced some mysql issues. So, I am trying to install mysql in my meteor app, but it always throwing me a error as 'couldn't install npm mysql package'. I have googled related to this issue, but none of them get resolved. I appreciate if anyone help me.
meteor npm install mysql
As mentioned in the comment:
Try:
npm config set strict-ssl false
and then
npm config set registry http://registry.npmjs.org/

node-gyp configure "binding.gyp not found (cwd: D:\MyProject) while trying to load binding.gyp"

I searched many and installed all necessary packages they said,
npm install --global --production windows-build-tools
node-gyp --python /path/to/python2.7
I have vs2017 installed in my win10 pc, I am using last versions of nodes tools
node -v //8.12.0
npm -v //6.4.1
I tried remove nodejs and reinstall to start fresh install but stuck in this step each,
here my .npmrc content;
strict-ssl=false
node_gyp=node C:\Users\ASUS\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js
msvs_version=2015
python=C:\Python27\python.exe
GYP_MSVS_VERSION=2015
ss of powershell, (node-gyp configure)
it looks for a file called 'binding.pyp'
If I add that file manually errormessage changes.. but other examples dont create any file they just install packges and run..
How can I fix this I searched on net many and did all advices(install ms build tools set msvs version 2017)

installing a downloaded library from github into vue project instead of just using npm

I'm having no luck installing https://github.com/MadimetjaShika/vuetify-google-autocomplete library using npm. I'm new to using vue, and I'd like to install the prerelease developers build, 2.0.0-Alpha.9, as the old one doesn't work with my version of vuetify.
I've downloaded and extracted the zip file and then used npm install (filepath of the downloaded folder), however when i run the project I get a 'can't find module 'vuetify-google-autocomplete' error. I've only installed packages directly via npm before so I'm not sure what I'm doing wrong.
You can install a specific version of a npm module by using npm tags
npm i vuetify-google-autocomplete#2.0.0-Alpha.9
You are unable to run it because what you downloaded is an npm repo by itself.
Go to the source folder , run the command npm install , then npm run build, copy the dist folder output to your project. How include that as a module and try.

Can't use npm_modules after installation

I'm starting a project where im going to use AngularJS, NodeJS and MySQL. This is my first real web application, and it's also the first time im using npm.
I've installed Node from their official website, and when i write npm install the node_modules comes to the project directory.
The problem occurs if I try to use any of the installed npm_modules. I tried to download mysql, and the installation worked, but when i type mysql -p i get: "bash: mysql: command not found"
I've also tried to install it with npm install mysql -g, but it still doesn't work.
If it means anything my $PATH is /usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/bin
The mysql npm package contains just the nodejs client library for mysql. You need to install the mysql server separately using the appropriate method for your OS.
it looks like you have not installed mysql on your system.
install mysql server using the following command
sudo apt-get install mysql-server