'In Tailwind CSS, installing the PostCSS plugin, when I run "npm run build" it shows me the below error. I tried a lot of time. What should I do?
In Windows, under PowerShell:
cd D:\TailwindCSS
cd gs3
npm run build
Output
[email protected] build D:\TailwindCSS\gs3
postcss ./src/tailwind.css -o ./public/tailwind.cssinternal/modules/run_main.js:54
internalBinding('errors').triggerUncaughtException( ^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs
are supported by the default ESM loader
←[90m at Loader.defaultResolve [as _resolve]
(internal/modules/esm/resolve.js:669:11)←[39m
←[90m at Loader.resolve
(internal/modules/esm/loader.js:97:40)←[39m
←[90m at Loader.getModuleJob
(internal/modules/esm/loader.js:243:28)←[39m
←[90m at ModuleWrap.
(internal/modules/esm/module_job.js:42:40)←[39m
←[90m at link (internal/modules/esm/module_job.js:41:36)←[39m {
code: ←[32m'ERR_UNSUPPORTED_ESM_URL_SCHEME'←[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:postcss ./src/tailwind.css -o \ ./public/tailwind.css
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above. \npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-
cache_logs\2021-12-01T04_42_15_907Z-debug.log
Solution 1:[1]
If you're on Node.js v12.18; technically, EMS is only supported in Node.js v12.20+
Update your Node.js to the latest version.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter Mortensen |
