Install of contextify failed on buster installation

157 views
Skip to first unread message

Stefan

unread,
Mar 14, 2012, 4:01:21 PM3/14/12
to Buster.JS
Hi,

I'm trying to install buster and get this WARN during installation:

> conte...@0.1.2 install /opt/local/lib/node_modules/buster/node_modules/buster-test/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild


> conte...@0.1.2 install /opt/local/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

sh: /opt/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp:
Permission denied
sh: /opt/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp:
Permission denied
npm WARN optional dependency failed, continuing conte...@0.1.2
npm WARN optional dependency failed, continuing conte...@0.1.2

Which causes severe problems when trying to run buster tests:


$ buster test -c buster.js

/opt/local/lib/node_modules/buster/node_modules/buster-test-cli/
node_modules/buster-syntax/node_modules/jsdom/lib/jsdom/browser/
index.js:26
global = vm.runInContext('this', sandbox);
^
TypeError: needs a 'context' argument.
at Object.getGlobal (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/
jsdom/lib/jsdom/browser/index.js:26:21)
at Object.createWindow (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/
jsdom/lib/jsdom/browser/index.js:308:23)
at Object.windowAugmentation (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/
jsdom/lib/jsdom/browser/index.js:63:24)
at Object.parentWindow (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/
jsdom/lib/jsdom/browser/index.js:605:28)
at Object.<anonymous> (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/
jsdom/lib/jsdom.js:81:15)
at Object.create (/opt/local/lib/node_modules/buster/node_modules/
buster-test-cli/node_modules/buster-syntax/lib/syntax.js:91:45)
at Object.create (/opt/local/lib/node_modules/buster/node_modules/
buster-test-cli/node_modules/buster-syntax/lib/extension.js:25:35)
at Object.beforeRunHook (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/lib/buster-test-cli/cli/runners/browser-
runner.js:39:44)
at Object.run (/opt/local/lib/node_modules/buster/node_modules/
buster-test-cli/lib/buster-test-cli/cli/runners/browser-runner.js:
23:14)
at Object.<anonymous> (/opt/local/lib/node_modules/buster/
node_modules/buster-test-cli/lib/buster-test-cli/cli/test.js:49:34)

My setup is like this:

Mac OS X 10.7.3
Installation of node via MacPorts: "port install nodejs", which
installs node to "/opt/local"
Change Permissions on "/opt/local" to avoid sudo when Installing npm:
"sudo chmod -R g+w /opt/local/"
Install npm via "curl http://npmjs.org/install.sh | sh"
Try to install buster via "npm install -g buster", which causes the
problem.

The permissions for /opt/local/lib/node_modules/npm/bin/node-gyp-bin/
node-gyp are like so:

$ ls -la /opt/local/lib/node_modules/npm/bin/node-gyp-bin
total 16
drwxr-xr-x 4 ssc admin 136 13 Mär 12:29 .
drwxr-xr-x 8 ssc admin 272 13 Mär 12:29 ..
-rw-r--r-- 1 ssc admin 89 13 Mär 02:50 node-gyp
-rw-r--r-- 1 ssc admin 61 13 Mär 02:50 node-gyp.cmd

"ssc" is my username, member of admin user group.

Any Ideas how to fix this?

Kind regards
Stefan

Stefan

unread,
Mar 14, 2012, 4:11:13 PM3/14/12
to Buster.JS
It did this and now it works:

npm uninstall -g buster
npm install -g node-gyp
npm install -g buster

Can anyone explain what I did? What is node-gyp? (I'm more or less a
node newbee..)

Stefan

Ryan Schmidt

unread,
Mar 14, 2012, 4:30:18 PM3/14/12
to bust...@googlegroups.com
On Mar 14, 2012, at 15:01, Stefan wrote:

> I'm trying to install buster and get this WARN during installation:
>
>> conte...@0.1.2 install /opt/local/lib/node_modules/buster/node_modules/buster-test/node_modules/jsdom/node_modules/contextify
>> node-gyp rebuild
>
>
>> conte...@0.1.2 install /opt/local/lib/node_modules/buster/node_modules/buster-test-cli/node_modules/buster-syntax/node_modules/jsdom/node_modules/contextify
>> node-gyp rebuild
>
> sh: /opt/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp:
> Permission denied
> sh: /opt/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp:
> Permission denied

Sounds like permission is denied; sounds like you're doing something without "sudo" when use of "sudo" is required.

> Mac OS X 10.7.3
> Installation of node via MacPorts: "port install nodejs", which
> installs node to "/opt/local"

You mean "sudo port install nodejs"

> Change Permissions on "/opt/local" to avoid sudo when Installing npm:
> "sudo chmod -R g+w /opt/local/"

What? Why?

> Install npm via "curl http://npmjs.org/install.sh | sh"

Why not "sudo port install npm"?

> Try to install buster via "npm install -g buster", which causes the
> problem.

Don't use "npm install -g" when node and/or npm have been installed using MacPorts. "npm install -g" would install files into the MacPorts prefix, and that's a no-no; MacPorts wants to be in control of all files installed into its prefix. Instead, for any software available in npm that desires to be installed globally, we should be creating separate MacPorts ports for them. This just came up again a couple days ago on a MacPorts list:

http://lists.macosforge.org/pipermail/macports-users/2012-March/027726.html

I have been meaning to create a busterjs port but haven't gotten around to it yet. Feel free to file a port request ticket in the MacPorts issue tracker so I don't forget about it again.

August Lilleaas

unread,
Mar 14, 2012, 6:09:39 PM3/14/12
to bust...@googlegroups.com
If you are inconsistent with your use on "sudo" when you use homebrew (read: install to /usr/local), major clusterfucks will occur.

So just make sure that you either use sudo all the time, or never.

Christian Johansen

unread,
Mar 14, 2012, 6:39:34 PM3/14/12
to bust...@googlegroups.com

FWIW I'm just back from two days of buster workshops, and a lot of people had this or similar problems. It happens for many combinations of sudo/no sudo, port/brew and whatnot. I'm gonna check if there's any plans for jsdom to drop the contextify dependency. If not, I'm keen on looking for alternatives. Dependencies that compile is just too much of a pain.

Christian

August Lilleaas

unread,
Mar 14, 2012, 6:47:54 PM3/14/12
to bust...@googlegroups.com
The installer we're gonna create for OS X and Windows will solve this problem for those platforms anyway.

(But making the installer is probably a hell of a lot easier if we don't use any libs that requires compilation.)

Stefan

unread,
Mar 15, 2012, 11:40:26 AM3/15/12
to Buster.JS
Hi Ryan,

thanks for the quick reply.

> Sounds like permission is denied; sounds like you're doing something without "sudo" when use of "sudo" is required.

Do you think? ;)

> > Mac OS X 10.7.3
> > Installation of node via MacPorts: "port install nodejs", which
> > installs node to "/opt/local"
>
> You mean "sudo port install nodejs"

Yes, of course. Sorry.

> > Change Permissions on "/opt/local" to avoid sudo when Installing npm:
> > "sudo chmod -R g+w /opt/local/"
>
> What? Why?

To avoid sudo when installing npm via "curl http://npmjs.org/install.sh|
sh", because the buster getting started notes:

"installing npm pacakges with sudo causes multiple problems, and is
not recommended."

And changing the permissions seems to be one way to avoid that:
https://gist.github.com/579814.

> > Install npm via "curlhttp://npmjs.org/install.sh| sh"
>
> Why not "sudo port install npm"?

Didn't know there's a port for npm. Didn't expected that.

> > Try to install buster via "npm install -g buster", which causes the
> > problem.
>
> Don't use "npm install -g" when node and/or npm have been installed using MacPorts. "npm install -g" would install files into the MacPorts prefix, and that's a no-no; MacPorts wants to be in control of all files installed into its prefix. Instead, for any software available in npm that desires to be installed globally, we should be creating separate MacPorts ports for them. This just came up again a couple days ago on a MacPorts list:
>
> http://lists.macosforge.org/pipermail/macports-users/2012-March/02772...
>

Aren't there quite a lot node packeges that add command line tools?
All of them should be wrapped as a port? Hmm...

> I have been meaning to create a busterjs port but haven't gotten around to it yet. Feel free to file a port request ticket in the MacPorts issue tracker so I don't forget about it again.

Probably I will build node directly in my home dir and don't use
MacPorts for that. Than using npm -g would not conflict with MacPorts.
But thank you very much anyway...
Reply all
Reply to author
Forward
0 new messages