Open
Description
Description
I create a test project
mkdir test
cd test
bit init
bit create express-serve api
bit install sqlite3
and add sqlite3 test code
import express from 'express';
import { Api } from "./api.js";
// sqlite3 test code
import sqlite3 from "sqlite3"
const Sqlite3 = sqlite3.verbose();
const db = new Sqlite3.Database("fire");
export function run() {
const app = express();
const api = Api.from();
const port = process.env.PORT || 3000;
/**
* learn more on the express docs:
* https://expressjs.com/en/starter/hello-world.html
*/
app.get('/', async (req, res) => {
const greeting = await api.getHello();
res.send(greeting);
});
const server = app.listen(port, () => {
console.log(`🚀 Server ready at: http://localhost:${port}`);
});
return {
port,
// implement stop to support HMR.
stop: async () => {
server.closeAllConnections();
server.close();
}
};
}
outpout
/Users/.../Documents/git/test/node_modules/.pnpm/[email protected]/node_modules/bindings/bindings.js:126
err = new Error(
^
Error: Could not locate the bindings file. Tried:
→ /Users/.../Documents/git/test/build/node_sqlite3.node
→ /Users/.../Documents/git/test/build/Debug/node_sqlite3.node
→ /Users/.../Documents/git/test/build/Release/node_sqlite3.node
→ /Users/.../Documents/git/test/out/Debug/node_sqlite3.node
→ /Users/.../Documents/git/test/Debug/node_sqlite3.node
→ /Users/.../Documents/git/test/out/Release/node_sqlite3.node
→ /Users/.../Documents/git/test/Release/node_sqlite3.node
→ /Users/.../Documents/git/test/build/default/node_sqlite3.node
→ /Users/.../Documents/git/test/compiled/20.11.1/darwin/x64/node_sqlite3.node
→ /Users/.../Documents/git/test/addon-build/release/install-root/node_sqlite3.node
→ /Users/.../Documents/git/test/addon-build/debug/install-root/node_sqlite3.node
→ /Users/.../Documents/git/test/addon-build/default/install-root/node_sqlite3.node
→ /Users/.../Documents/git/test/lib/binding/node-v115-darwin-x64/node_sqlite3.node
at bindings (/Users/.../Documents/git/test/node_modules/.pnpm/[email protected]/node_modules/bindings/bindings.js:126:9)
at node_modules/.pnpm/[email protected]/node_modules/sqlite3/lib/sqlite3-binding.js (/Users/.../Documents/git/test/node_modules/.pnpm/[email protected]/node_modules/sqlite3/lib/sqlite3-binding.js:1:18)
at __require (/Users/.../Documents/git/test/node_modules/.pnpm/file+my-scope+api/node_modules/@my-scope/api/dist/api.cjs:8:50)
at node_modules/.pnpm/[email protected]/node_modules/sqlite3/lib/sqlite3.js (/Users/.../Documents/git/test/node_modules/.pnpm/[email protected]/node_modules/sqlite3/lib/sqlite3.js:2:17)
at __require (/Users/.../Documents/git/test/node_modules/.pnpm/file+my-scope+api/node_modules/@my-scope/api/dist/api.cjs:8:50)
at Object.<anonymous> (/Users/.../Documents/git/test/node_modules/.pnpm/file+my-scope+api/node_modules/@my-scope/api/dist/api.app-root.ts:4:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12) {
tries: [
'/Users/.../Documents/git/test/build/node_sqlite3.node',
'/Users/.../Documents/git/test/build/Debug/node_sqlite3.node',
'/Users/.../Documents/git/test/build/Release/node_sqlite3.node',
'/Users/.../Documents/git/test/out/Debug/node_sqlite3.node',
'/Users/.../Documents/git/test/Debug/node_sqlite3.node',
'/Users/.../Documents/git/test/out/Release/node_sqlite3.node',
'/Users/.../Documents/git/test/Release/node_sqlite3.node',
'/Users/.../Documents/git/test/build/default/node_sqlite3.node',
'/Users/.../Documents/git/test/compiled/20.11.1/darwin/x64/node_sqlite3.node',
'/Users/.../Documents/git/test/addon-build/release/install-root/node_sqlite3.node',
'/Users/.../Documents/git/test/addon-build/debug/install-root/node_sqlite3.node',
'/Users/.../Documents/git/test/addon-build/default/install-root/node_sqlite3.node',
'/Users/.../Documents/git/test/lib/binding/node-v115-darwin-x64/node_sqlite3.node'
]
}
Specifications
- Bit version:v1.6.106
- Node version:v18.20.1
- npm / yarn version:10.5.0
- Platform:macOS Monterey 12.5
- Bit compiler (include version):
- Bit tester (include version):
Activity