Tagged: npm

Nextjs

TypeScript error: Cannot find module 'X' or its corresponding type declarations

Either the package isn't installed, or it doesn't ship its own TypeScript types and you're missing the matching `@types/` package. Try installing `@types/<package-name>` — if that package doesn't exist either, the library likely has no type support and you'll need a manual type declaration.

Draft·
Deployment

Module not found: Can't resolve 'tailwindcss' after Vercel build

Vercel's production install can prune devDependencies before the build step in some configurations, so if `tailwindcss` (or another build-time tool) is listed only under `devDependencies`, the build can fail even though it works locally. Move build-critical packages to `dependencies`, or confirm your install command isn't skipping dev packages.

Draft·
Nodejs

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath is not defined by exports

The package defines an `exports` field in its package.json that doesn't list the deep path you're importing (e.g. `some-lib/dist/internal/thing`). Packages using `exports` block any subpath not explicitly declared there, even if the file physically exists — import from the package's documented public entry point instead.

Draft·
Nodejs

Error: The module was compiled against a different Node.js version (NODE_MODULE_VERSION mismatch)

A native (C++) addon was compiled against a different Node.js ABI version than the one you're currently running — typically after upgrading Node without reinstalling native dependencies. Delete node_modules and reinstall, or run a rebuild, so the addon is recompiled against your current Node version.

Draft·
Nodejs

npm error ERESOLVE: unable to resolve dependency tree

Two of your dependencies require conflicting versions of the same peer dependency, and npm (since v7) refuses to silently guess which one to use. Update the conflicting packages to compatible versions where possible; `--legacy-peer-deps` is a last resort that may install a version that isn't actually compatible.

Draft·