node -v
v4.4.7
npm -v
v2.15.8
node-gyp -v
v3.4.0
Run Code Online (Sandbox Code Playgroud)
我正在尝试运行使用libxmljs模块的节点应用程序,我收到了这个奇怪的错误:
libxmljs/node_modules/bindings/bindings.js:83
throw e
^
Error: /link/node_modules/libxmljs/build/Release/xmljs.node: undefined symbol: _ZN2v82V837AdjustAmountOfExternalAllocatedMemoryEl
at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at bindings (/link/node_modules/libxmljs/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/link/node_modules/libxmljs/lib/bindings.js:1:99)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
Run Code Online (Sandbox Code Playgroud)
我试着再次npm update安装libxmljs.不行.有小费吗?
当运行我的项目包时,在我尝试使用安装该包后,出现上述标题错误
npm 安装 xml2json
但是,我只遇到以下错误,您能给我建议或想法来摆脱这个问题吗?
D:\xampp\htdocs\podio>npm install xml2json
> node-expat@2.3.16 install D:\xampp\htdocs\podio\node_modules\node-expat
> node-gyp rebuild
D:\xampp\htdocs\podio\node_modules\node-expat>if not defined npm_config_node_gyp
(node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
D:\xampp\htdocs\podio\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\
libexpat\version.c
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft …Run Code Online (Sandbox Code Playgroud) 我在 libxmljs 存储库上发布了一个问题,它被关闭了,因为他们认为这在 lib 级别不是问题。所以我把它贴在这里。
我正在尝试使用 OASIS 提供的 XML 模式验证 XLIFF 文件,但我一直收到 XSD 错误。
错误:Request._callback (/Users/fluxb0x/Tests/xliff_parser/main.js) 处的 Document.validate (/Users/fluxb0x/Tests/xliff_parser/node_modules/libxmljs/lib/document.js:73:17) 处的 XSD 架构无效:25:21) 在 Request.emit (events.js:98:17) 在 Request.emit (events.js:98:17) 在 Request.self.callback (/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:199:22)。(/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:1160:14) 在 IncomingMessage 的 Request.emit (events.js:117:20)。(/Users/fluxb0x/Tests/xliff_parser/node_modules/request/request.js:1111:12) at IncomingMessage.emit (events.js:117:20) at _stream_readable.js:938:16 at process._tickCallback (node. js:419:13)
我已经使用 Oxygen XML 编辑器来测试验证,它没有问题。
这是我导出的 XLIFF 文件:en.xliff
这是 OASIS 提供的 XSD 文件:xliff_schema.xsd
相当大的文件。
感谢您的帮助。
我在我的mac os x 10.9.3上构建libxmljs时遇到了问题.
这是我得到的:
3 warnings generated.
CC(target) Release/obj.target/libxml/vendor/libxml/xpointer.o
LIBTOOL-STATIC Release/xml.a
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/xml.a] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/libxmljs
gyp ERR! node -v v0.10.13 …Run Code Online (Sandbox Code Playgroud) :) I chose for automated testing a tool Cypress.io. I need some tests for my sitemap.xml document and I dont know how to do that :(
I have tried install an npm package libxmljs
npm install libxmljs --save
and load it as plugin in cypress/plugins/index.js
const libxmljs = require('libxmljs');
Run Code Online (Sandbox Code Playgroud)
But there is a problem with this. It shows an error
The plugins file is missing or invalid.
Your pluginsFile is set to /home/my-app/cypress/plugins/index.js, but
either the file is missing,
it …Run Code Online (Sandbox Code Playgroud) 如何在 Node.js 中验证格式良好的 xml?我主要感兴趣的是仅检查文件是否格式正确。另外,我想收到发生错误的行号。
我有以下测试 xml:
<?xml version="1.0" encoding="UTF-8" ?>
<body>
<tagname>
test1
</tag.name> <--- error here
<tagname>
test2
</tagname>
</body>
Run Code Online (Sandbox Code Playgroud)
到目前为止我已经尝试过:
xmldom:
var parser = new DOMParser({errorHandler: (level, error) => {
console.log (level, error);
}});
var dom = parser.parseFromString(content, 'application/xml');
Run Code Online (Sandbox Code Playgroud)
问题:没有任何错误提示。错误处理程序永远不会被调用,并且 dom 包含“test1”但不包含“test2”。所以解析器只是停止并吞掉错误。
libxmljs:
var xmlDoc = libxmljs.parseXml(xml);
Run Code Online (Sandbox Code Playgroud)
问题:抛出无用的异常“标记体内数据过早结束”。
libxml-js ×6
node.js ×5
cypress ×1
javascript ×1
macos ×1
node-gyp ×1
npm ×1
npm-install ×1
sitemap ×1
validation ×1
xliff ×1
xml ×1
xmldom ×1