Skip to content

Instantly share code, notes, and snippets.

var Promise = require('bluebird');
var knex = require('knex')({
client: 'mysql',
connection: {
host: '127.0.0.1',
user: 'root',
password: '',
database: 'steam',
charset: 'utf8'
var Promise = require('bluebird');
var knex = require('knex')({
client: 'mysql',
connection: {
host: '127.0.0.1',
user: 'root',
password: '',
database: 'steam',
charset: 'utf8'

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
import json, re, shlex, urllib.request
watch = []
def getPrice(item):
listings = json.loads(urllib.request.urlopen(makeUrl(item)).read().decode("utf-8"))["listinginfo"]
lowest = None
for id, obj in list(listings.items()):
try:
price = obj["converted_price"]