Trying to run node-twitter-api-v2 in a nodejs electronjs app, I get this message
Module not found: Error: Can't resolve 'crypto'Module not found: Error: Can't resolve 'https'Module not found: Error: Can't resolve 'zlib'Module not found: Error: Can't resolve 'fs'
I've tried to put in package.json the following without success
"browser": {
"crypto": false,
"stream": false
},
Then I have added this in webpack.main.config.js
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: {
main: './src/main.js',
},
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
https: require.resolve('https-browserify'),
zlib: require.resolve('browserify-zlib'),
fs: require.resolve('fs-extra'),
},
},
}
Trying to run node-twitter-api-v2 in a nodejs electronjs app, I get this message
Module not found: Error: Can't resolve 'crypto'
Module not found: Error: Can't resolve 'https'
Module not found: Error: Can't resolve 'zlib'
Module not found: Error: Can't resolve 'fs'
I've tried to put in
package.json
the following without successThen I have added this in
webpack.main.config.js
and yarn-installed the 5 modules.
No success, the error messages are the same.
I paste here the dependencies
node version 16.13.1, windows 10