gpt4 book ai didi

node.js - Node -v 0.6.19。 libxmljs。类型错误 : Cannot read property 'prototype' of undefined

转载 作者:太空宇宙 更新时间:2023-11-04 01:15:09 28 4
gpt4 key购买 nike

在 Ubuntu 11.10 上, Node 0.6.17、0.6.18 和 0.6.19 安装了 libxml2 (2.7.8) 和 libxml2-dev - 一切正常。

在 Node 为 0.6.19、libxml2 版本 20708(xmllint --version;xmllint:使用 libxml 版本 20708)的 FreeBSD 服务器上,它会给出以下错误消息:

/home/pathtofile/www/node_modules/libxmljs/lib/element.js:24
Element.prototype = bindings.Element.prototype;
^
TypeError: Cannot read property 'prototype' of undefined
at Object. (/home/pathtofile/www/node_modules/libxmljs/lib/element.js:24:37)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (/home/pathtofile/www/node_modules/libxmljs/lib/document.js:3:15)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)

最佳答案

在调用 xml 对象之前添加到代码中:

var xml = require("libxmljs")

关于node.js - Node -v 0.6.19。 libxmljs。类型错误 : Cannot read property 'prototype' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11013371/

28 4 0
文章推荐: html -
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com