Sign in to follow this  
el9in

Проблема > Error: Error: Cannot find module 'mysql'

Recommended Posts

Писал и < npm update mysql > и < npm -g update mysql > и < npm update -g mysql >

console.log("step 0");

var mysql = require('mysql');

var mysqlc = mysql.createConnection({
    host:'localhost',// host of server
    user:'root',// MySQL user
    password:'',// MySQL password
    database:'rage_bados'// MySQL database
});

mysqlc.connect(function(e) {
if(e) {
	console.log("Error connecting to the database with error "+e);
}
else {
	console.log('Database connected!')
}
});

mysqlc.end();

mysqlc.query("SELECT * FROM `users` WHERE `nickname`=", [], function(e, r) {
if(e) {
console.log('Error on connection ... ');
throw e;
}
else {
console.log('Password is '+r[0].passcode);
}
});

 

Error: Error: Cannot find module 'mysql'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (D:\RAGEMP\server-files\packages\freeroam\index.js:15:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

 

Share this post


Link to post
Share on other sites
В 04.08.2019 в 14:09, el9in сказал:

Писал и < npm update mysql > и < npm -g update mysql > и < npm update -g mysql >

console.log("step 0");

var mysql = require('mysql');

var mysqlc = mysql.createConnection({
    host:'localhost',// host of server
    user:'root',// MySQL user
    password:'',// MySQL password
    database:'rage_bados'// MySQL database
});

mysqlc.connect(function(e) {
if(e) {
	console.log("Error connecting to the database with error "+e);
}
else {
	console.log('Database connected!')
}
});

mysqlc.end();

mysqlc.query("SELECT * FROM `users` WHERE `nickname`=", [], function(e, r) {
if(e) {
console.log('Error on connection ... ');
throw e;
}
else {
console.log('Password is '+r[0].passcode);
}
});

 

Error: Error: Cannot find module 'mysql'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (D:\RAGEMP\server-files\packages\freeroam\index.js:15:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

 

Установи: HAAMP

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.