Y
Y
Yojj2019-07-07 15:25:27
Node.js
Yojj, 2019-07-07 15:25:27

NodeJS 9.2: parcel + sqlite3 - how to solve the error?

There was a need in the html page to display data from the sqlite
database on NodeJS 9.2 using "parcel": "^1.12.3", "sqlite": "^3.0.3"
I run npm run build, then parcel index.html, but an error occurs

Server running at http://localhost:1234 
...../MyProj/node_modules/node-pre-gyp/lib/node-pre-gyp.js:136:48: Cannot statica
lly evaluate fs argument
  134 |   var dir = this.opts.directory;
  135 |   if (dir == null) dir = process.cwd();
> 136 |   var package_json = JSON.parse(fs.readFileSync(path.join(dir,'package.json')));
      |                                                ^
  137 | 
  138 |   this.todo = napi.expand_commands (package_json, this.opts, commands);
  139 | 
✨  Built in 9.18s.

The obvious answer is not googling. Is it possible to solve without reducing the Node version?
or perhaps there is an alternative module for sqlite?
Thank you

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question