Freshworks SDK (fdk) not getting installed throwing sqlite3 manual install error

Facing issues while installing the Freshdesk SDK (fdk), it asks to install sqlite3 package manually, upon installing it globally, issue still persists, it still says to install sqlite3 package

Also terminal code for the same

node-pre-gyp info This Node instance does not support builds for N-API version 6
node-pre-gyp info This Node instance does not support builds for N-API version 6
/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81
        throw new Error(`Please install ${moduleName} package manually`);
        ^

Error: Please install sqlite3 package manually
    at ConnectionManager._loadDialectModule (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81:15)
    at new ConnectionManager (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:24:21)
    at new SqliteDialect (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/sqlite/index.js:15:30)
    at new Sequelize (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/sequelize.js:340:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/lib/instances/sequelize.js:26:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/lib/utils/data-util.js:11:19)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)

Please help install the fdk

Os - ubuntu 20
we did install sqlite3 by following commands
npm i sqlite3 -g
sudo apt-get install sqlite3 libsqlite3-dev

but still fdk throws Error: Please install sqlite3 package manually

@Saif please help in resolving this issue

Hi @Naved_Ahmad, @gourav.kumar
Welcome to the community & Thanks for bringing this to our attention. Can you cd into FDK’s node_modules directory

cd /usr/local/lib/node_modules/fdk/node_modules

and execute the following command?

npm rebuild

This should fix the issue with regards to the sqlite3 dependency error. In the meanwhile, we will check as to why this happens in the first place.

Hi

we did try running command npm rebuild as well but the error still persist

Hi @gourav.kumar,
Can you help me with the following details ? -> Node version, OS, FDK version(prev/ current) ?

node version 10.18
OS - ubuntu 20
FDK version - cannot find as running fdk command throws error
fdk is installed by ruuning command npm install https://dl.freshdev.io/cli/fdk.tgz -g
FDK is installed first time so there is no prev version

1 Like

Are you sure that you are with node 10.18?
I’m asking because it happened to me too.
Then I remembered that I have more than one node installed.
Checked which one was active with:

node -v

and it was the last version. Then I changed to 10.18:

nvm use 10.18

and everything works fine now.

Perhaps you installed FDK in another version.
You have to first set to 10.18, then install the FDK.

5 Likes

I double what Samuel Pares says. Can you please verify whether the FDK is stared and the sqlite3 is also installed with node 10 version. That would be very useful here.
TIA

1 Like

Hi
There is only one node version in the system that is 10.18.1
I uninstalled fdk, installed sqlite3, installed fdk and then ran coomand npm run build
but still getting same error.

I installed fdk with version 10.18.1 only, as that is the only version of node in my nvm, still the issue persists

Error: Please install sqlite3 package manually

Yes sqlite3 is also installed with node version 10.18

Error while executing fdk command

{ Error: Cannot find module '/usr/local/lib/node_modules/fdk/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/node_modules/sqlite3/lib/sqlite3-binding.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/node_modules/sqlite3/lib/sqlite3.js:2:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32) code: 'MODULE_NOT_FOUND' }
/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:83
        throw new Error(`Please install ${moduleName} package manually`);
        ^

Error: Please install sqlite3 package manually
    at ConnectionManager._loadDialectModule (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:83:15)
    at new ConnectionManager (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:24:21)
    at new SqliteDialect (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/dialects/sqlite/index.js:15:30)
    at new Sequelize (/usr/local/lib/node_modules/fdk/node_modules/sequelize/lib/sequelize.js:340:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/lib/instances/sequelize.js:26:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/fdk/lib/utils/data-util.js:11:19)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)

It is unable to find module ‘/usr/local/lib/node_modules/fdk/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node’

@Naved_Ahmad My suggestion would be to completely remove node and nvm from your machine. Including any local path associations. Then go through the process mentioned here for setting up the Freshworks SDK. I have ran into issues where fdk was not a recognized command and found out it was due to another version of node installed and was setting itself as default even after changing my default node version to 10.18. Computer would show 10.18 when I ran node --version . But was actually set to version 12.x.

Just a thought. Good luck!

-Zach

3 Likes

Hi,

We did try all the shared steps but still fdk is throwing same error. This is impacting our timeline to migrate freshsales to freshworks crm. can we schedule a meeting? pls share your availability for the meeting

Hi @gourav.kumar,

We believe that this could be due to an issue with sqlite3 5.0.1 package. Unfortunately others have noted the same issue with that version

Can you attempt a downgrade of sqlite3 version to 5.0.0?

Here’s how you can do that

  1. cd into the FDK installed directory. In my case it was
cd /usr/local/lib/node_modules/fdk
  1. You can uninstall the previously installed sqlite3 package using the following command
npm uninstall sqlite3
  1. Proceed to downgrade to v5.0.0 using the following command after uninstallation
npm i sqlite3@5.0.0

(optional step) You can verify if 5.0.0 sqlite3 has been installed using the npm list command like so

$ npm list -g --depth 1
/usr/local/lib
`-- fdk@6.9.6
  +-- @commitlint/execute-rule@11.0.0
  +-- @commitlint/load@11.0.0
  +-- adm-zip@0.4.16
  +-- UNMET PEER DEPENDENCY ajv@4.11.8
  +-- ajv-keywords@3.5.2
  +-- archiver@1.3.0
  +-- async@2.6.3
  +-- bindings@1.5.0
  +-- body-parser@1.19.0
  +-- cachedir@2.2.0
  +-- cheerio@0.22.0
  +-- commitizen@4.2.3
  +-- cz-customizable@6.3.0
  +-- eslint@4.19.1
  +-- esprima@4.0.1
  +-- express@4.17.1
  +-- express-ws@3.0.0
  +-- faker@4.1.0
  +-- fs-extra@1.0.0
  +-- gulp@4.0.2
  +-- gulp-replace@0.5.4
  +-- husky@4.3.8
  +-- image-size@0.5.1
  +-- inquirer@7.3.3
  +-- istanbul@0.4.5
  +-- istanbul-lib-instrument@3.3.0
  +-- jquery-deferred@0.3.1
  +-- json-schema-faker@0.5.0-rc16
  +-- lodash@4.17.10
  +-- mocha@5.2.0
  +-- moment-timezone@0.5.32
  +-- nan@2.14.2
  +-- ngrok@3.4.0
  +-- nock@9.6.1
  +-- node-dir@0.1.16
  +-- nodetree@0.0.3
  +-- npm@4.1.1
  +-- nyc@11.9.0
  +-- passport@0.3.2
  +-- passport-oauth2@1.5.0
  +-- passport-oauth2-refresh@1.1.0
  +-- proxyquire@2.1.3
  +-- request@2.88.0
  +-- requestretry@4.1.2
  +-- sequelize@6.5.0
  +-- sequelize-cli@6.2.0
  +-- sinon@6.3.5
  +-- sqlite3@5.0.0
  +-- supertest@3.4.2
  +-- sync-request@5.0.0
  +-- umzug@2.3.0
  +-- uuid@3.4.0
  +-- validator@9.4.1
  +-- websocket@1.0.33
  `-- wiz-cliparse@0.5.4

Let me know if that works

3 Likes

Thanks Hemchander, this solution works for me I had to use sudo npm install sqlite3@5.0.0 -g
sqlite3 version 5.0.0 works

2 Likes

Thanks, @Naved_Ahmad. This version fix will be a part of the upcoming FDK version :slight_smile:

1 Like