botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
71 stars 83 forks source link

Sqlite3 install and run issues #159

Closed jsalwen closed 6 years ago

jsalwen commented 6 years ago

I am no longer able to get Botpress to run. In order to submit PR botpress/botpress#309 using async / await, I updated nodejs. Previously, I had a much older version.

But is I try to install botpress-messenger or botpress-slack, I get the sqlite3 error see https://github.com/botpress/v12/issues/120

foo-bot>bp install botpress-messenger
[botpress]       please wait, we are trying to install your new modules...
[botpress]       Installing modules: botpress-messenger
[botpress]       ERR npm
[botpress]       ERR WARN botpress-messenger@2.2.9 requires a peer of botpress@>= 0.1 but none is installed. You must install peer dependencies yourself.
npm WARN react-audio-player@0.5.0 requires a peer of react@15.x but none is installed. You must install peer dependencies yourself.
npm WARN react-audio-player@0.5.0 requires a peer of react-dom@15.x but none is installed. You must install peer dependencies yourself.
npm WARN react-player@0.18.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN foo-bot4@0.0.1 No description
npm WARN foo-bot4@0.0.1 No repository field.
npm WARN foo-bot4@0.0.1 license should be a valid SPDX license expression

[botpress]       ERR npm ERR! path c:\projects\foo-bot\node_modules\sqlite3\node_modules\node-pre-gyp\node_modules\mkdirp\node_modules\minimist
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'c:\projects\foo-bot\node_modules\sqlite3\node_modules\node-pre-gyp\node_modules\mkdirp\node_modules\minimist' -> 'c:\projects\foo-bot\node_modules\sqlite3\node_modules\node-pre-gyp\node_modules\mkdirp\node_modules\.minimist.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

[botpress]       ERR
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\me\AppData\Roaming\npm-cache\_logs\2017-12-20T00_01_18_935Z-debug.log

[botpress]       ERR An error occurred during modules installation.
Unhandled rejection undefined

At this point, nothing works. I can't run bp start

foo-bot>bp start
[botpress]       ERR Cannot find module 'c:\projects\foo-bot\node_modules\botpress'
[botpress]       ERR Error: Cannot find module 'c:\projects\foo-bot\node_modules\botpress'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Command.module.exports.module.exports (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\lib\node.bundle.js:1863:31)
    at Command.listener (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\node_modules\commander\index.js:315:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:194:7)
    at Command.parseArgs (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\node_modules\commander\index.js:653:12)
    at Command.parse (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\node_modules\commander\index.js:475:21)
    at Object.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\lib\node.bundle.js:1613:120)
    at __webpack_require__ (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\lib\node.bundle.js:21:30)
    at Object.CLI (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\lib\node.bundle.js:1541:10)
    at Object.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\botpress\bin\botpress:3:34)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
[botpress]       ERR (fatal) Could not load the local version of botpress
[botpress]       Hint: 1) have you used `botpress init` to create a new bot the proper way?
[botpress]       Hint: 2) Do you have read and write permissions on the current directory?
[botpress]       -------------
[botpress]       If none of the above works, this might be a bug in botpress. Please contact the Botpress Team on gitter and provide the printed error above.

The root of this appears to be related to sqlite3, but it is an issue for botpress, so I think we need to find a fix. It is looking like a show stopper for me.

I completely uninstalled node and tried a couple of different installs, but I am getting the same issues.

Please also fill in these fields:


Botpress version: 1.1.10

jsalwen commented 6 years ago

@elliott-beach @slvnperron any suggestions?

slvnperron commented 6 years ago

@jsalwen Which version of node are you using? SQLite is broken on many versions / OS. SQLite works well under node version 8.0 for darwin x86_64, perhaps worth trying 8.0 ?

slvnperron commented 6 years ago

I am thinking we should remove SQLite as a Botpress dependency and make the driver swappable, i.e. have a botpress-db-sqlite and botpress-db-postgres module instead.

jsalwen commented 6 years ago

@slvnperron I tried node versions 7.10.1 and 8.9.3. What version of 8.x are you using?

jsalwen commented 6 years ago

@slvnperron I updated sqlite3 to ^3.1.13 in my local botpress, and it seemed to fix it.

There was a PR to fix the node-pre-gyp issue with not passing parameters.. https://github.com/mapbox/node-pre-gyp/pull/301 It was an issue with newer versions of npm: https://github.com/mapbox/node-pre-gyp/pull/301/files#diff-180360612c6b8c4ed830919bbb4dd459R31

jsalwen commented 6 years ago

I am no longer having issues starting with version 1.1.11 with sqlite3 version 3.1.13

saitaiky commented 6 years ago

@jsalwen Could you tell me where I can change the sqlite3 to ^3.1.13? I can't find my botpress folder at the global environment in my Mac..

jsalwen commented 6 years ago

@saitai0802 you can install the latest version of Botpress. The current version on npm is 1.1.12 so it will have the updated version of sqlite3

npm update -g botpress

saitaiky commented 6 years ago

@jsalwen Thank you for your reply!

When I run the npm install -g botpress installation command, this below line kept popping non-stop:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/botpress/node_modules/sqlite3/.node-gyp/8.9.4"

After I terminate that installation then run npm update -g botpress botpress init

It shows up installation error then terminated my installation.. do you have any idea what happened? npm ERR! path /vagrant/botpress-sandbox/myproject/node_modules/sqlite3/node_modules/verror/node_modules/assert-plus/package.json.1217345269 npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/vagrant/botpress-sandbox/myproject/node_modules/sqlite3/node_modules/verror/node_modules/assert-plus/package.json.1217345269' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

saitaiky commented 6 years ago

Seems the problem is lots of people can't even install sqlite3 correctly... https://github.com/mapbox/node-sqlite3/issues/866 If there any workaround for case?

salehinRafi commented 6 years ago

@saitai0802 it happens to me a few days back. I try above solution as well but still, the problem persists. This is what I did to solve:

  1. run npm outdated inside the project folder (will show old version even already run command npm update -g botpress)
  2. Directly update using npm updateinside the folder will solve the issues for me.
epaminond commented 6 years ago

Since issue seems to be solved, closing this.

gddh commented 6 years ago

Even after running, npm update -g botpress, I'm getting the issue. Following the previous git thread, I tried uninstalling and reinstalling sql as well. Then I read this thread and it seemed that all we had to do was update botpress. First time using botpress. Just to be clear, right now I've done the following:

First thing

  1. npm install -g botpress
  2. create an empty directory and cd into it.
  3. npm update -g botpress
  4. botpress init 4.botpress install messenger

It will say the module was successfully installed, but I can't go onto local host!

Here is the error after botpress install messenger

[botpress]   please wait, we are trying to install your new modules...
[botpress]   Installing modules: botpress-messenger
[botpress]   ERR npm
[botpress]   ERR  WARN react-codemirror@1.0.0 requires a peer of react@>=15.5 <16 but none is installed. You must install peer dependencies yourself.
npm WARN react-codemirror@1.0.0 requires a peer of react-dom@>=15.5 <16 but none is installed. You must install peer dependencies yourself.
npm WARN react-jsonschema-form@0.49.0 requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN
[botpress]   ERR  react-player@0.18.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-audio-player@0.5.0 requires a peer of react@15.x but none is installed. You must install peer dependencies yourself.
npm 
[botpress]   ERR WARN react-audio-player@0.5.0 requires a peer of react-dom@15.x but none is installed. You must install peer dependencies yourself.
npm WARN
[botpress]   ERR  test@0.0.1 No description
npm WARN
[botpress]   ERR  test@0.0.1 No repository field.
npm WARN
[botpress]   ERR  test@0.0.1 license should be a valid SPDX license expression

[botpress]   ERR 

[botpress]   + botpress-messenger@2.2.11
added 7 packages in 5.357s

[botpress]   OK Modules successfully installed

Here is what happens when i try to bp start


[botpress]   OK Modules successfully installed

-MacBook-Pro:test gddh$ bp start
14:08:37 - info: Starting botpress version 1.1.13
14:08:37 - verbose: [UMM] Enabled for facebook
14:08:37 - info: Loaded botpress-messenger, version 2.2.11
14:08:37 - verbose: [UMM] Enabled for web
14:08:37 - info: Loaded botpress-web, version 1.2.3
14:08:37 - info: Loaded 2 modules
14:08:37 - debug: Loading middleware: UMM.instrumentation
14:08:37 - debug: Loading middleware: hear
14:08:37 - debug: Loading middleware: conversations
14:08:37 - debug: Loading middleware: messenger.sendMessages
14:08:37 - debug: Loading middleware: web.sendMessages
14:08:37 - debug: Loading middleware: fallback
14:08:37 - info: [notification::botpress] botpress-messenger.config.yml has been created, fill it
14:08:37 - info: Bot launched. Visit: http://localhost:3000
14:08:37 - warn: [botpress-messenger] Configuration is incomplete, applicationID needs to be defined. See "./botpress-messenger.config.yml".
14:08:37 - warn: [botpress-messenger] Configuration is incomplete, accessToken needs to be defined. See "./botpress-messenger.config.yml".
14:08:37 - warn: [botpress-messenger] Configuration is incomplete, appSecret needs to be defined. See "./botpress-messenger.config.yml".
14:08:37 - warn: [botpress-messenger] Configuration is incomplete, hostname needs to be defined. See "./botpress-messenger.config.yml".
14:08:37 - error: [notification::botpress] Error updating Messenger App. Please see logs for details.```