Skip to content

Instantly share code, notes, and snippets.

exports.knex = require('knex')({
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'myapp_test',
charset : 'utf8'
}
});
@zkochan
zkochan / gist:3de6ec2e1b00dd95a43b
Created January 6, 2015 09:13
Node-inspector exception when running it against ActionHero on Windows
debugger listening on port 5858
C:\node-dev\actionHero-tutorial\node_modules\.bin\actionHero:2
basedir=`dirname “$0"`
^
SyntaxError: Unexpected token ILLEGAL
node —debug ./node_modules/.bin/actionHero start
node —debug ./node_modules/actionHero/bin/actionHero start
var knex = require('knex');
exports.knex = function (api, next) {
api.knex = knex(api.configData.mySql);
next();
}
configData.mySql = {
database: 'actionHero',
username: 'root',
password: 'root',
host: '127.0.0.1',
port: 3306,
}
$ npm install knex@0.6 --save
# Then add one of the following (adding a --save) flag:
$ npm install mysql
$ npm install mariasql
$ npm install pg
$ npm install sqlite3
gyp ERR! stack Error: Python executable “python” is v3.4.1, which is not supported by gyp.
‘pg_config’ is not recognized as an internal or external command,
operable program or batch file.
gyp: Call to ‘pg_config —includedir’ returned exit status 1. while trying to load binding.gyp
./node_modules/.bin/actionhero generateInitializer —name=knex