Webpack Error: please install sqlite3 package manually - javascript

I'm building an application with Electron and Sequelize. I started to configure my database, then, I've received this error:
Uncaught Error: Please install sqlite3 package manually
at new ConnectionManager (/home/matheusdrdj/Documentos/Git/personal-
management/node_modules/sequelize/lib/dialects/sqlite/con…:31)
at new SqliteDialect (/home/matheusdrdj/Documentos/Git/personal-
management/node_modules/sequelize/lib/dialects/sqlite/ind…:14)
at new Sequelize (/home/matheusdrdj/Documentos/Git/personal-
management/node_modules/sequelize/lib/sequelize.js:239)
at eval (index.js?17a5:3)
at Object. (renderer.js:1084)
at webpack_require (renderer.js:680)
at fn (renderer.js:90)
at eval (index.js?21f1:1)
at Object. (renderer.js:1077)
at webpack_require (renderer.js:680)
at fn (renderer.js:90)
at eval (main.js?3b76:1)
at Object. (renderer.js:918)
at webpack_require (renderer.js:680)
at fn (renderer.js:90)
at Object. (renderer.js:835)
at webpack_require (renderer.js:680)
at renderer.js:726
at renderer.js:729
I have installed sqlite3 globally and localy, tested it on the console and it's working fine. But, my application doesn't even load the screen.
My dependencies:
"dependencies": {
"axios": "^0.16.1",
"sequelize": "^4.37.7",
"sqlite3": "^4.0.0",
"vue": "^2.4.2",
"vue-electron": "^1.0.6",
"vue-router": "^2.5.3",
"vuetify": "1.0.0",
"vuex": "^2.3.1"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"babili-webpack-plugin": "0.1.2",
"cfonts": "^1.1.3",
"chalk": "^2.1.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.5",
"css-loader": "^0.28.4",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^1.7.5",
"electron-builder": "^19.19.1",
"electron-debug": "^1.4.0",
"electron-devtools-installer": "^2.2.0",
"electron-rebuild": "^1.7.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"html-webpack-plugin": "^2.30.1",
"js-sha256": "^0.9.0",
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"style-loader": "^0.18.2",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"url-loader": "^0.5.9",
"vue-html-loader": "^1.2.4",
"vue-loader": "^13.0.5",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.4.2",
"webpack": "^3.5.2",
"webpack-dev-server": "^2.7.1",
"webpack-hot-middleware": "^2.18.2"
}
I cannot figure out what is happening.

With Electron sqlite3 has to be built with electron-builder.
How to use sqlite3 module with electron?
and https://github.com/electron-userland/electron-builder
both recommend adding this to your package.json
"postinstall": "electron-builder install-app-deps"
This will rebuild all native binaries everytime you install a new package.

Related

Dependencies were not found despite existing in package.json

EDIT: This question is related to #56558281 however it's two years old and hasn't been answered
I'm refactoring a few apps we have and tried moving a block of JS code from one NestJs app into another Nuxt app. After installing the dependencies I get this error:
These dependencies were not found: friendly-errors 11:04:41
friendly-errors 11:04:41
* child_process in ./node_modules/google-auth-library/build/src/auth/googleauth.js friendly-errors 11:04:41
* fs in ./node_modules/google-auth-library/build/src/auth/googleauth.js, ./node_modules/google-p12-pem/build/src/index.js and 4 others
friendly-errors 11:04:41
To install them, you can run: npm install --save child_process fs
I tried running npm install --save child_process fs without luck
Tried deleting node modules and clearing the cache then reinstalling with no luck
and I tried adding this block as per this answer without luck either
"browser":{
"child_process": false
}
Package.json
...
"dependencies": {
"#nuxt/types": "^2.14.5",
"#nuxtjs/apollo": "^4.0.1-rc.5",
"#nuxtjs/axios": "^5.12.5",
"#nuxtjs/gtm": "^2.2.2",
"#nuxtjs/vuetify": "^1.11.0",
"apollo-link-http": "^1.5.17",
"child_process": "^1.0.2",
"filestack-js": "^3.16.0",
"googleapis": "^39.2.0",
"google-auth-library": "^3.1.2",
"graphql": "^15.5.1",
"graphql-tag": "^2.12.5",
"isomorphic-fetch": "^3.0.0",
"net": "^1.0.2",
"nuxt": "^2.0.0",
"nuxt-i18n": "^6.12.2",
"nuxt-webfontloader": "^1.1.0",
"pluralize": "^8.0.0",
"readline": "^1.3.0",
"tls": "^0.0.1",
"typescript": "^3.0.0",
"url-slug": "^2.2.0",
"vue": "^2.6.11",
"vue-apollo": "^3.0.7",
"vue-infinite-loading": "^2.4.5",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
"#mdi/font": "^5.3.45",
"#nuxt/typescript-build": "^2.0.3",
"#nuxtjs/eslint-config-typescript": "^3.0.0",
"#nuxtjs/eslint-module": "^2.0.0",
"#types/pluralize": "0.0.29",
"#vue/test-utils": "^1.0.0-beta.27",
"babel-eslint": "^10.0.1",
"babel-jest": "^26.0.1",
"deepmerge": "^4.2.2",
"eslint": "^7.9.0",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"fibers": "^5.0.0",
"jest": "^26.0.1",
"pug": "^2.0.3",
"pug-plain-loader": "^1.0.0",
"sass": "^1.26.11",
"sass-loader": "^8.0.2",
"typed-graphqlify": "^2.2.3",
"vue-class-component": "^7.1.0",
"vue-jest": "^4.0.0-beta.3",
"vue-property-decorator": "^9.0.0"
},
"browser":{
"child_process": false
}

Tried to register two views with the same name RCTScrollView

i try to run my react native app to ios but i got this error, while in android the app work just fine, do someone know about this ?
xcode 11.5,
rn 0.61.5,
using react native cli
i already search on several site but dont seem find any solution, here the screen shoot :
"dependencies": {
"#microsoft/signalr": "^3.1.3",
"#react-native-community/async-storage": "^1.7.1",
"#react-native-community/datetimepicker": "^2.2.1",
"#react-native-community/masked-view": "0.1.5",
"#react-native-community/picker": "^1.6.1",
"#react-native-community/viewpager": "3.3.0",
"#sentry/react-native": "^1.4.1",
"axios": "^0.19.1",
"color": "^3.1.2",
"ellipsize": "^0.1.0",
"form-data": "^3.0.0",
"google-translate": "^3.0.0",
"i18n-js": "^3.5.1",
"intl": "^1.2.5",
"moment": "^2.24.0",
"moment-range": "^4.0.2",
"numeral": "^2.0.6",
"opentok-react-native": "^0.12.2",
"react": "16.9.0",
"react-cookies": "^0.1.1",
"react-native": "0.61.5",
"react-native-amazing-cropper": "^0.1.1",
"react-native-biometrics": "^2.1.4",
"react-native-camera": "^3.17.0",
"react-native-collapsible": "^1.5.1",
"react-native-daterange-picker": "^1.1.3",
"react-native-device-info": "^5.5.3",
"react-native-file-picker": "0.0.19",
"react-native-geocoder": "^0.5.0",
"react-native-gesture-handler": "^1.5.3",
"react-native-image-crop-tools": "^1.3.4",
"react-native-image-picker": "^2.3.0",
"react-native-localize": "^1.4.0",
"react-native-location": "^2.5.0",
"react-native-masked-text": "^1.13.0",
"react-native-onesignal": "^3.6.3",
"react-native-overlay-section": "0.1.13",
"react-native-paper": "3.4.0",
"react-native-reanimated": "^1.4.0",
"react-native-responsive-screen": "1.4.0",
"react-native-safe-area-context": "0.6.2",
"react-native-screens": "2.0.0-alpha.22",
"react-native-vector-icons": "^6.6.0",
"react-native-webview": "8.1.1",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^2.0.4",
"react-navigation-tabs": "^2.7.0",
"react-redux": "^7.1.3",
"reanimated-bottom-sheet": "1.0.0-alpha.18",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"sendbird": "3.0.117",
"styled-components": "^4.4.1",
"throttle-debounce": "^2.1.0",
"validator": "^12.1.0"
},
The error is coming from the react-native-gesture-handler package.
Did you import it in your code ? If yes, try to remove the import and do a rm -rf node_modules && npm install.
If this doesn't work, try to update it (Latest version at the moment is ^1.6.1) in your package.json.
sorry just found the problem, in my app there are custom native library that use scroll view in folder src, that causing register view two times.

Babel-Loader Error Plugin/Preset files are not allowed to export objects, only functions

After updating all my outdated npm packages to #latest, my electron app fails to start, giving the error
ERROR in ./src/index.js
[0] Module build failed (from ./node_modules/babel-loader/lib/index.js):
[0] Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/nyxynyx/foobar/node_modules/babel-preset-stage-0/lib/index.js
Any idea what went wrong? Thank you everyone!
.babelrc
{
"presets": ["env", "stage-0", "react"],
"plugins": [
"babel-plugin-styled-components",
"react-hot-loader/babel",
["transform-class-properties", { "loose": true }]
]
}
package.json (dependencies & devDependencies)
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.21",
"#fortawesome/free-solid-svg-icons": "^5.10.1",
"#fortawesome/react-fontawesome": "^0.1.4",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"babel-plugin-styled-components": "^1.10.6",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"bootstrap": "^4.3.1",
"css-loader": "^3.2.0",
"electron-log": "^3.0.7",
"electron-updater": "^4.1.2",
"file-loader": "^4.2.0",
"firebase": "^6.3.4",
"fix-path": "^2.1.0",
"json-loader": "^0.5.7",
"lodash": "^4.17.15",
"menubar": "^6.0.7",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-redux": "^7.1.0",
"react-redux-firebase": "^2.3.0",
"reactstrap": "^8.0.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"style-loader": "^1.0.0",
"styled-components": "^4.3.2",
"typeface-open-sans": "0.0.75",
"url-loader": "^2.1.0"
},
"devDependencies": {
"concurrently": "^4.1.1",
"devtron": "^1.4.0",
"electron": "^6.0.1",
"electron-builder": "^21.2.0",
"electron-debug": "^3.0.1",
"electron-devtools-installer": "^2.2.4",
"eslint": "^6.1.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"express": "^4.17.1",
"react-dom": "^16.8.6",
"react-hot-loader": "^4.12.10",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1",
"stylelint": "^10.1.0",
"stylelint-config-standard": "^18.3.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.39.1",
"webpack-dev-middleware": "^3.7.0",
"webpack-hot-middleware": "^2.25.0",
"webpack-merge": "^4.2.1"
},
Using node v12.6.0 on Mac OS X Mojave 10.14.5
I am moving my answer from comment due to lack of space there :)
Try using new packages for babel-core, babel-register and presets, replacing the old ones since they are depricated (babel-core, babel-presets-env, etc):
#babel/core - https://www.npmjs.com/package/#babel/core,
#babel/presets-env - https://babeljs.io/docs/en/babel-preset-env,
#babel/presets-react - https://babeljs.io/docs/en/babel-preset-react,
#babel/presets-stage-0 https://babeljs.io/docs/en/babel-preset-stage-0,
#babel/polyfill - https://babeljs.io/docs/en/babel-polyfill and
#babel/register - https://babeljs.io/docs/en/babel-register.
Then try deleting package.lock, and running again npm i . If that is not helping you can also try deleting node_modules folder, and running npm i again
babel-preset-env / babel-preset-react packages are deprecated.
use #babel/preset-env and #babel/preset-react packages.
And do the following change in .babelrc :
"presets": ["#babel/env", "#babel/react"]
That is due to outdated babel packages being used. The babel project, just like most other active Javascript projects, have moved on to using scope packages. Hence, the package names starts with #babel
Check this to fix issue

BackAndroid is deprecated and has been removed from this package. Use BackHandler instead

I updated the version of React, Expo and React-Native
Now I have a red screen on my device saying that BackAndroid is deprecated and has been removed from this package. Use BackHandler instead But I don't where is BackAndroid, I can't know it is used in which package.
That's my package.json
"#expo/vector-icons": "^9.0.0",
"babel-plugin-module-resolver": "^3.1.3",
"babel-plugin-transform-react-jsx-source": "^6.22.0",
"babel-preset-expo": "^5.0.0",
"expo": "^33.0.0",
"lato-font": "^3.0.0",
"lodash": "^4.17.14",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-app-intro-slider": "0.2.4",
"react-native-bottomsheet": "^1.9.3",
"react-native-customisable-switch": "^0.1.0",
"react-native-dialog-input": "^1.0.7",
"react-native-gesture-handler": "^1.0.0-alpha.43",
"react-native-image-base64": "^0.1.3",
"react-native-js-bottom-sheet": "^1.1.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-loading-spinner-overlay": "^1.0.1",
"react-native-modal": "5.4.0",
"react-native-modalbox": "^1.7.1",
"react-native-prompt": "^1.0.0",
"react-native-prompt-android": "^0.3.5",
"react-native-swipeable": "^0.6.0",
"react-native-tab-view": "^0.0.77",
"react-native-vector-icons": "^6.2.0",
"react-navigation": "^2.18.0",
"react-waterfall": "3.0.7",
"sentry-expo": "^1.7.0",
"tcomb-form-native": "0.6.11",
"timeago.js": "^3.0.2"
the error

Errors on my code are alerts, instead of console.errors

I'm working on Vue.js project, and suddely errors than where errors on console, (console.error) are alerts, (normal browser alerts).
Example. I force this error writing (undefined).anyProperty
console looks:
My package.json modules:
"dependencies": {
"axios": "^0.18.0",
"bootstrap-vue": "^2.0.0-rc.11",
"naranja": "^1.0.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"node-sass": "^4.11.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"sass-loader": "^7.1.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
I cand debug in alerts, because objects are [Object object], thanks for helps.
I don't know anything about Vue, but my recommendation for debugging this would be to replace the window.alert function with you own function containing a debugger
let oldWindowAlert = window.alert;
window.alert = function(){
debugger;
oldWindowAlert.apply(window, arguments);
}
Then, once you catch the debugger, you can investigate the call stack (in Chrome this is very easy) to trace down what function is emitting this alert.
So I did a bit of research for you, but haven't actually tested my hypothesis so take this with a grain of salt...
My gut tells me that somewhere in the code there is an event handler attached to the window error event which alerts the error message and swallows the error. Search the codebase for addEventHandler('error', addEventHandler("error", and onerror, and get rid of it :-)
The docs lead me to believe that Node_Notifier is the culprit. Hard to tell without seeing your code but maybe see what happens if you remove it?

Categories