Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite3 install and run issues #159

Closed
2 tasks done
jsalwen opened this issue Dec 20, 2017 · 13 comments
Closed
2 tasks done

Sqlite3 install and run issues #159

jsalwen opened this issue Dec 20, 2017 · 13 comments

Comments

@jsalwen
Copy link

jsalwen commented Dec 20, 2017

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.

  • Now, I can create a new bot: 'bp init bot-name`
  • I can start the bot: bp start

But is I try to install botpress-messenger or botpress-slack, I get the sqlite3 error
see #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 [email protected] requires a peer of botpress@>= 0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] 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.

  • OS: Windows 10
  • Check that you are using node version >= 7.10.1 and 8.9.3
  • Search the documentation

Please also fill in these fields:


Botpress version: 1.1.10

@jsalwen
Copy link
Author

jsalwen commented Dec 20, 2017

@elliott-beach @slvnperron any suggestions?

@slvnperron
Copy link
Member

@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
Copy link
Member

slvnperron commented Dec 20, 2017

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
Copy link
Author

jsalwen commented Dec 20, 2017

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

@jsalwen
Copy link
Author

jsalwen commented Dec 20, 2017

@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.. mapbox/node-pre-gyp#301
It was an issue with newer versions of npm: https://github.com/mapbox/node-pre-gyp/pull/301/files#diff-180360612c6b8c4ed830919bbb4dd459R31

slvnperron referenced this issue in botpress/botpress Dec 21, 2017
#325 update sqlite3 to version 3.1.13 to fix issues on windows
@jsalwen
Copy link
Author

jsalwen commented Dec 29, 2017

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

@saitaiky
Copy link

saitaiky commented Jan 9, 2018

@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
Copy link
Author

jsalwen commented Jan 9, 2018

@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
Copy link

saitaiky commented Jan 10, 2018

@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
Copy link

Seems the problem is lots of people can't even install sqlite3 correctly... TryGhost/node-sqlite3#866
If there any workaround for case?

@salehinRafi
Copy link

@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 update inside the folder will solve the issues for me.

@epaminond
Copy link

Since issue seems to be solved, closing this.

@gddh
Copy link

gddh commented May 11, 2018

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 [email protected] requires a peer of react@>=15.5 <16 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@>=15.5 <16 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN
[botpress] 	 ERR  [email protected] requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm 
[botpress] 	 ERR WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN
[botpress] 	 ERR  [email protected] No description
npm WARN
[botpress] 	 ERR  [email protected] No repository field.
npm WARN
[botpress] 	 ERR  [email protected] license should be a valid SPDX license expression

[botpress] 	 ERR 

[botpress] 	 + [email protected]
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.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants