creationix / wheat

Wheat is a blog engine for coders written in node.JS
Other
1.36k stars 134 forks source link

Error in prettify.js - Cannot set property console of #<Object> which has only a getter #20

Open ghost opened 13 years ago

ghost commented 13 years ago

When I try to run howtonode.org (using spark in the directory that has app.js) after installing wheat 0.1.5 using npm (running node v0.4.0-pre), I get the following error

node.js:116 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Cannot set property console of # which has only a getter at Object. (/home/dev/local/lib/node/.npm/wheat/0.1.5/package/lib/wheat/prettify.js:62:20) at Module._compile (module.js:302:26) at Object..js (module.js:308:10) at Module.load (module.js:234:31) at Function._load (module.js:201:10) at require (module.js:246:19) at Object. (/home/dev/local/lib/node/.npm/wheat/0.1.5/package/lib/wheat/renderers.js:5:16) at Module._compile (module.js:302:26) at Object..js (module.js:308:10) at Module.load (module.js:234:31)

The line it's referring to is

window.console = console;

Any ideas?

Node & NPM were installed using this method (and therefore live in ~/local) if it makes any difference - https://gist.github.com/579814#file_only_git_all_the_way.sh

bdarcus commented 13 years ago

Ditto here.

TooTallNate commented 13 years ago

Change the line slightly above in prettify.js from:

window = GLOBAL;

to:

window = this;

I'm preparing a patch, but I think this is an external library of some sort.