タイトルの設定で動かない
エラー
こんな実行時エラー
internal/validators.js:117
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:117:11)
at dirname (path.js:1128:5)
at Function.getRoot (webpack:///./node_modules/bindings/bindings.js?:154:13)
at bindings (webpack:///./node_modules/bindings/bindings.js?:60:32)
at eval (webpack:///./node_modules/libxmljs/lib/bindings.js?:1:92)
at Object../node_modules/libxmljs/lib/bindings.js (/home/user/dist/index.js:118:1)
at __webpack_require__ (/home/user/dist/index.js:20:30)
at eval (webpack:///./node_modules/libxmljs/index.js?:4:16)
at Object../node_modules/libxmljs/index.js (/home/user/dist/index.js:107:1)
at __webpack_require__ (/home/user/dist/index.js:20:30) {
code: 'ERR_INVALID_ARG_TYPE'
}
対応
ここの記述どおりに修正する。
node_modules/libxmls/lib/bindings.js
// module.exports = require('bindings')('xmljs');
module.exports = require('bindings')({
"bindings": "xmljs",
"module_root": process.cwd() + "/node_modules/libxmljs",
});