pnpx tailwindcss init -p
Cannot find module gen-mapping.umd.js
#15363
-
What version of Tailwind CSS are you using?
What build tool (or framework if it abstracts the build tool) are you using?
What version of Node.js are you using?
What browser are you using?
What operating system are you using?
Describe your issue I was following the guidance in the Install Tailwind CSS with Vite guide to create a React TypeScript project using pnpm. However, when I ran the second step > pnpx tailwindcss init -p
node:internal/modules/cjs/loader:641
throw e;
^
Error: Cannot find module 'C:\Users\xxx\AppData\Local\pnpm-cache\dlx\4rg7jemirruotlw3nojgw7yowy\193afa628f4-30b8\node_modules\.pnpm\[email protected]\node_modules\@jridgewell\gen-mapping\dist\gen-mapping.umd.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1262:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1250:15)
at resolveExports (node:internal/modules/cjs/loader:634:14)
at Module._findPath (node:internal/modules/cjs/loader:724:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (C:\Users\xxx\AppData\Local\pnpm-cache\dlx\4rg7jemirruotlw3nojgw7yowy\193afa628f4-30b8\node_modules\.pnpm\s[email protected]\node_modules\sucrase\dist\computeSourceMap.js:1:92)
at Module._compile (node:internal/modules/cjs/loader:1469:14) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\xxx\\AppData\\Local\\pnpm-cache\\dlx\\4rg7jemirruotlw3nojgw7yowy\\193afa628f4-30b8\\node_modules\\.pnpm\\[email protected]\\node_modules\\@jridgewell\\gen-mapping\\package.json'
}
Node.js v20.17.0 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey! This looks like it's coming from I would suggest to try with If you want to use |
Beta Was this translation helpful? Give feedback.
-
If you're using pnpm use the command |
Beta Was this translation helpful? Give feedback.
Hey!
This looks like it's coming from
pnpx
and not Tailwind CSS itself (nothing in the stacktrace points to tailwindcss). My assumption is that you will run into this issue with other setups as well if you usepnpx
.I would suggest to try with
npx
instead.If you want to use
pnpx
, I would recommend to clear your pnpm-cache usingpnpm store prune
(https://pnpm.io/cli/store#prune) and see if that helps.