This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Power Profiler Kit modification for long time measurements: Problem with npm

Hello,

my goal is to measure the average current consumption of an external chip connected to the Power Profiler Kit on Windows 7. Since the Software inside the nRF Connect App only allows a maximum of 120s, I want to modify the NodeJS source code and save all measured current values into an SQLite3 database. Afterwards I want to do the averaging by myself by evaluating the database file. My modification inside the Chart.jsx file starts like this:

const sqlite3 = require('sqlite3').verbose();

My problem is about including the sqlite3 module into the package. After using "npm install sqlite3" (I also tried many options like  --build-from-source or --save) there is the right directory in node_modules and the command "npm run dev" succeeds. But at runtime I receive the error: 

 Cannot find module 'C:\Users\MyUser\.nrfconnect-apps\local\pc-nrfconnect-ppk-master\...\node_sqlite3.node'

The required node file is actually located in C:\Users\MyUser\.nrfconnect-apps\local\pc-nrfconnect-ppk-master\node_modules\sqlite3\lib\binding\node-v57-win32-ia32
Any suggestions how to make the node file visible to the package? In the error message there are only the dots in the path, so I also don't know where the programm is searching for the file.

Hope you can help.

Kind regards,

Christian
Parents Reply Children
No Data
Related