Error: Cannot find module 'ws'
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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