sql-js / sql-js/sql.js

Error: Cannot find module 'ws'

Open
#112 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm using npm to install sql.js. But when watchify try to bundle the app up, it will throw this error:

 Error: Cannot find module 'ws' from 'C:\my_location\node_modules\sql.js\js'

And in the js file, I only have something like this:

var fs = require('fs');
var SQL = require('sql.js');

var filebuffer = fs.readFileSync('../../db/my_db.sqlite');
var _sqlConn = new SQL.Database(filebuffer);

I'm using a Windows 7 laptop

I really don't know how can i solve this, thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the consuming JavaScript entry point and the node_modules/sql.js/js path named in the error; reproduce the npm/watchify bundle and inspect how the ws dependency is resolved. Done means the application bundles without the reported missing-module error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.