Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'obsidian' #2463

Open
a-phe-lei-a opened this issue Oct 28, 2024 · 0 comments
Open

Error: Cannot find module 'obsidian' #2463

a-phe-lei-a opened this issue Oct 28, 2024 · 0 comments
Labels
bug Something isn't working.

Comments

@a-phe-lei-a
Copy link

What happened?

I’d like to play with the dataview API on external dev env, but right from the start there appears to be a problem with the installation. I did npm install -D obsidian-dataview.
But a simple code like

import { getAPI } from “obsidian-dataview”;
console.log(“test”)

I get the error Error: Cannot find module 'obsidian'. However, the module seems to be installed.

Error: Cannot find module 'obsidian'
Require stack:
- /Users/spyros.m/Documents/Obsidian/node_modules/obsidian-dataview/lib/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at Object.<anonymous> (/Users/a-phe-lei-a/Documents/Obsidian/node_modules/obsidian-dataview/lib/index.js:5:1)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object..js (node:internal/modules/cjs/loader:1689:10)
    at Module.load (node:internal/modules/cjs/loader:1318:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/a-phe-lei-a/Documents/Obsidian/node_modules/obsidian-dataview/lib/index.js'
  ]
}

DQL

No response

JS

No response

Dataview Version

[email protected]

Obsidian Version

1.7.4

OS

MacOS

@a-phe-lei-a a-phe-lei-a added the bug Something isn't working. label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant