Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing jsdom via npm on windows fails on contextify #378

Closed
tmundal opened this issue Dec 23, 2011 · 13 comments
Closed

Installing jsdom via npm on windows fails on contextify #378

tmundal opened this issue Dec 23, 2011 · 13 comments

Comments

@tmundal
Copy link

tmundal commented Dec 23, 2011

D:\node.js>npm install jsdom
npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/htmlparser
npm http 304 https://registry.npmjs.org/request
npm WARN htmlparser@1.7.3 package.json: bugs['web'] should probably be bugs['url
']

contextify@0.0.7 preinstall D:\node.js\node_modules\jsdom\node_modules\context
ify
node-waf clean || (exit 0); node-waf configure build

node-waf was unexpected at this time.
npm ERR! error installing contextify@0.0.7
npm ERR! error installing jsdom@0.2.10
npm ERR! Error: ENOENT, no such file or directory 'D:\node.js\node_modules\jsdom
\node_modules___cssom.npm\package\comments.js'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "jsdom"
npm ERR! cwd D:\node.js
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! path D:\node.js\node_modules\jsdom\node_modules___cssom.npm\package\co
mments.js
npm ERR! fstream_path D:\node.js\node_modules\jsdom\node_modules___cssom.npm\pa
ckage\comments.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'D:\node.js\node_modules\jsdo
m\node_modules___cssom.npm\package\comments.js'
npm ERR! fstream_stack Object.oncomplete (C:\Program Files\nodejs\node_modules\n
pm\node_modules\fstream\lib\writer.js:204:26)
npm ERR! Error: ENOENT, no such file or directory 'D:\node.js\node_modules\jsdom
\node_modules___request.npm\package\tests\test-body.js'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "jsdom"
npm ERR! cwd D:\node.js
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! path D:\node.js\node_modules\jsdom\node_modules___request.npm\package
tests\test-body.js
npm ERR! fstream_path D:\node.js\node_modules\jsdom\node_modules___request.npm
package\tests\test-body.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'D:\node.js\node_modules\jsdo
m\node_modules___request.npm\package\tests\test-body.js'
npm ERR! fstream_stack Object.oncomplete (C:\Program Files\nodejs\node_modules\n
pm\node_modules\fstream\lib\writer.js:285:17)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\node.js\npm-debug.log
npm not ok

@brianmcd
Copy link
Contributor

For installing Contextify on Windows, see:

I'll add some documentation on installation issues/windows to the Contextify README sometime in the next few days.

@tommedema
Copy link

Same issue here.

E:\Workspaces\Javascript\ContentExtractor>npm install jsdom
npm http GET https://registry.npmjs.org/jsdom
npm http 200 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/jsdom/-/jsdom-0.2.10.tgz
npm http 200 https://registry.npmjs.org/jsdom/-/jsdom-0.2.10.tgz
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/htmlparser
npm http 200 https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.3.tgz
npm http 200 https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/contextify/-/contextify-0.0.7.tgz
npm http 200 https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cssom/-/cssom-0.2.1.tgz
npm http 200 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/request/-/request-2.2.9.tgz
npm http 200 https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.3.tgz
npm http 200 https://registry.npmjs.org/contextify/-/contextify-0.0.7.tgz
npm http 200 https://registry.npmjs.org/cssom/-/cssom-0.2.1.tgz
npm http 200 https://registry.npmjs.org/request/-/request-2.2.9.tgz
npm WARN htmlparser@1.7.3 package.json: bugs['web'] should probably be bugs['url
']
npm WARN htmlparser@1.6.2 package.json: bugs['web'] should probably be bugs['url
']

> contextify@0.0.7 preinstall E:\Workspaces\Javascript\ContentExtractor\node_mod
ules\jsdom\node_modules\contextify
> node-waf clean || (exit 0); node-waf configure build

node-waf niet verwacht op dit moment.
npm ERR! error installing contextify@0.0.7
npm ERR! error installing jsdom@0.2.10
npm ERR! contextify@0.0.7 preinstall: `node-waf clean || (exit 0); node-waf conf
igure build`
npm ERR! `cmd "/c" "node-waf clean || (exit 0); node-waf configure build"` faile
d with 1
npm ERR!
npm ERR! Failed at the contextify@0.0.7 preinstall script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf clean || (exit 0); node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "jsdom"
npm ERR! cwd E:\Workspaces\Javascript\ContentExtractor
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! code ELIFECYCLE
npm ERR! message contextify@0.0.7 preinstall: `node-waf clean || (exit 0); node-
waf configure build`
npm ERR! message `cmd "/c" "node-waf clean || (exit 0); node-waf configure build
"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     E:\Workspaces\Javascript\ContentExtractor\npm-debug.log
npm not ok

@dobesv
Copy link

dobesv commented Dec 25, 2011

Windows doesn't support native modules right now, and contextify is a native module. The only way around it would be to not use contextify somehow or change contextify to work without a native module. Or wait for native module support in windows.

Ideally jsdom could be changed to use the built in 'vm' module instead of contextify: http://nodejs.org/docs/v0.6.3/api/vm.html

However, it may be that jsdom cannot operate as it does now using the 'vm' module so switching to the 'vm' module might require removing some features from jsdom that existing code relies on.

@MarcDiethelm
Copy link

I'm seeing this on Macos as well.

@joshchan
Copy link

joshchan commented Jan 4, 2012

On Mac OS X you need to first install Xcode, or something else that provides gcc.

@bojanbjelic
Copy link

Same issue.
Create an issue on npm first, and npm / @isaacs commented:

"This is a jsdom bug. It should list contextify as an optionalDependency, or not use it at all. node-waf will never work on windows."
(https://github.com/isaacs/npm/issues/2061#issuecomment-3569282)

Is it possible that contextify can be optional here?

@brianmcd
Copy link
Contributor

See: #398 . You should also be able to build Contextify on Windows using node-gyp and the latest Contextify master (https://github.com/brianmcd/contextify).

@thisandagain
Copy link

I'm seeing this on MacOS with the latest version of XCode (4.3.1) installed as well.

@brianmcd
Copy link
Contributor

Are you running the latest node? If not, try installing 0.6.12. There were some issues with 0.6.11 being distributed as a 32-bit binary, but the workarounds to fix that broke the install for some other people. 0.6.12 is a fat binary, and things should just work now with 0.6.12.

@thisandagain
Copy link

Yup... Node 0.6.12:

'configure' finished successfully (0.078s)
Waf: Entering directory `/home/brianmcd/projects/test-install/node_modules/contextify/build'
Waf: Leaving directory `/home/brianmcd/projects/test-install/node_modules/contextify/build'
Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
    return build_impl(bld)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
    bld.compile()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
    os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/home/brianmcd/projects/test-install/node_modules/contextify/build'
npm ERR! error installing contextify@0.1.2
npm ERR! error installing jsdom@0.2.13

npm ERR! contextify@0.1.2 preinstall: `node-waf clean || (exit 0); node-waf configure build`
npm ERR! `sh "-c" "node-waf clean || (exit 0); node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the contextify@0.1.2 preinstall script.

[...]

@brianmcd
Copy link
Contributor

Ok, thanks. Working on this now.

@brianmcd
Copy link
Contributor

I think this should be fixed now. Somehow my build/ folder got into the npm package, even though my .npmignore file has build/ in it. Thanks for the heads up.

Edit: you might need to do an npm cache clean to get rid of the cached bad package.

@thisandagain
Copy link

Thank you for the quick patch! Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants