Open vedmant opened 8 years ago
Using electron + webpack too.
I get this Error:
path.js:7 Uncaught TypeError: Path must be a string. Received undefined
And error's source is:
var expat = require('bindings')('node_expat')
Webpack give this warnning:
./app/~/bindings/bindings.js
Critical dependencies:
76:22-40 the request of a dependency is an expression
76:43-53 the request of a dependency is an expression
Looks like bindings cause this error, but how can I fix it?
Thanks!
cd ./node_modules/node-expat
and then
node-gyp rebuild --target=1.7.8 --arch=x64 --dist-url=https://atom.io/download/electron
rebuild see electron doc
if you use webpack to bundle some posts or use webpack-node-externals
I use this boilerplate https://github.com/chentsulin/electron-react-boilerplate
Installed node-expat, then when I try to import it with
import expat from 'node-expat';
I get following error:Uncaught Error: Could not locate the bindings file. Tried: → project/build/node_expat.node → project/build/Debug/node_expat.node → project/build/Release/node_expat.node → project/out/Debug/node_expat.node → project/Debug/node_expat.node → project/out/Release/node_expat.node → project/Release/node_expat.node → project/build/default/node_expat.node → project/compiled/6.5.0/darwin/x64/node_expat.node
When I tried to copy node_expat.node file to project/build folder, I get following:
bindings.js:83 Uncaught Error: Module version mismatch. Expected 50, got 48.