-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Just got tripped up by this, but figured it out (my npm package was missing an index.cjs file). Would've figured it out sooner if we'd had an error log (which indeed was TODO), so just tracking this.
react-native-node-api/packages/host/src/node/path-utils.ts
Lines 262 to 263 in 80ae73b
| } catch { | |
| // TODO: Add a debug log here |
export function resolvePackageRoot(
// createRequire(path.join("/Users/jamie/Documents/git/expo-macos-nativescript", "noop.js"))
requireFromPackageRoot: NodeJS.Require,
// "@nativescript/macos-node-api"
packageName: string,
): string | undefined {
try {
const resolvedPath = requireFromPackageRoot.resolve(packageName);
return packageDirectorySync({ cwd: resolvedPath });
} catch {
// TODO: Add a debug log here
return undefined;
}
}Error: Cannot find module '/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/@nativescript/macos-node-api/index.cjs'
at createEsmNotFoundErr (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1493:15)
at finalizeEsmResolution (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1482:9)
at resolveExports (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:685:14)
at Module._findPath (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:752:31)
at Module._resolveFilename (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/cjs/loader.js:1441:27)
at require.resolve (/Users/jamie/Documents/git/expo-macos-nativescript/lib/internal/modules/helpers.js:163:19)
at eval (<node_internals>/eval-b052276f.repl:1:30)
at resolvePackageRoot (/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/react-native-node-api/dist/node/path-utils.js:215:9)
at /Users/jamie/Documents/git/expo-macos-nativescript/node_modules/react-native-node-api/dist/node/path-utils.js:247:40
at Array.flatMap (<anonymous>) {code: 'MODULE_NOT_FOUND', path: '/Users/jamie/Documents/git/expo-macos-nativescript/node_modules/@nativescript/macos-node-api', stack: "Error: Cannot find module '/Users/jamie/Docum….js:247:40
at Array.flatMap (<anonymous>)", message: "Cannot find module '/Users/jamie/Documents/g…ules/@nativescript/macos-node-api/index.cjs'"}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers