Skip to content

ERR_UNKNOWN_BUILTIN_MODULE attempting to require('node:sqlite') in v22.5.0 #53905

Description

@trentm

Version

v22.5.0

Platform

% uname -a
Darwin peach.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64

Subsystem

node:sqlite

What steps will reproduce the bug?

require('node:sqlite')

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior? Why is that the expected behavior?

The Node.js v22.5.0 blog post mentions a new node:sqlite core package: https://nodejs.org/en/blog/release/v22.5.0
However, attempting to require it throws ERR_UNKNOWN_BUILTIN_MODULE. I'd expect it to work.

What do you see instead?

% node
Welcome to Node.js v22.5.0.
Type ".help" for more information.
> require('node:sqlite')
Uncaught Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:sqlite
    at Module._load (node:internal/modules/cjs/loader:1038:13)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16) {
  code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}

Additional information

No response

Activity

  1. cjihrig commented on Jul 17, 2024

    @cjihrig
    Contributor

    You need to start Node with the --experimental-sqlite flag.

  2. trentm commented on Jul 17, 2024

    @trentm
    ContributorAuthor

    Ah, thanks.
    Would it be reasonable to add that requirement to the https://nodejs.org/api/sqlite.html docs?

  3. cjihrig commented on Jul 17, 2024

    @cjihrig
    Contributor

    Seems like a good idea.

  4. trentm commented on Jul 17, 2024

    @trentm
    ContributorAuthor

    Should I morph this issue? I'm not sure of best practice here.

  5. avivkeller commented on Jul 17, 2024

    @avivkeller
    Member

    If it was me, I'd close this issue, and open a PR to improve the docs.

    Thanks!

  6. added
    sqliteIssues and PRs related to the SQLite subsystem.
    on Jul 17, 2024
  7. trentm commented on Jul 17, 2024

    @trentm
    ContributorAuthor

    I've opened #53906 for the doc issue. Thanks.

  8. Sudiptobhukta commented on Jul 19, 2024

    @Sudiptobhukta

    If this issue is open I like to be assigned to it. Thank you!

    SQLlite

    And I think adding this piece of information to start Node with the --experimental-sqlite
    after the heading in a brackets would be beneficiary for people

  9. avivkeller commented on Jul 19, 2024

    @avivkeller
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sqliteIssues and PRs related to the SQLite subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions