x [错误] [插件esbuild-style-plugin] Postcss配置文件在e:\ ... \ postcss.config.js可以加载。

发布于 2025-01-20 22:40:28 字数 1792 浏览 3 评论 0原文

错误[err_unsupported_esm_url_scheme]:默认的ESM加载程序仅支持文件和数据URL。在Windows上,绝对路径必须是有效的文件:// URL。收到的协议 'E:' 在New Nodeerror(节点:内部/错误:371:5) 在Defaultresolve(节点:内部/模块/ESM/RESOLVE:1016:11) 在esmloader.resolve(节点:内部/模块/ESM/LOADER:422:30) 在esmloader.getModuleJob(节点:内部/模块/ESM/LOADER:222:40) 在esmloader.import(节点:内部/模块/ESM/LOADER:276:22) 在ImportModuledynemallynymanically(节点:内部/模块/CJS/LOADER:1041:29) 在ImportModuledynemallyallyallywrapper(节点:内部/VM/模块:437:21) 在ImportModuledysnemallyaly中(节点:VM:381:46) 在importModuledynemallycallback(节点:内部/process/esm_loader:35:14) 在importPostcssconfigfile(e:\ team ### niledashboard \ nile-dashboard \ nile-dashboard \ node_modules \ esbuild-style-plugin \ dist \ dist \ index.js:76:22){ 代码:'err_unsupported_esm_url_scheme' ...

错误[err_unsupported_esm_url_scheme]:默认的ESM加载程序仅支持文件和数据URL。在Windows上,绝对路径必须是有效的文件:// URL。收到的协议 'E:' 在New Nodeerror(节点:内部/错误:371:5) 在Defaultresolve(节点:内部/模块/ESM/RESOLVE:1016:11) 在esmloader.resolve(节点:内部/模块/ESM/LOADER:422:30) 在esmloader.getModuleJob(节点:内部/模块/ESM/LOADER:222:40) 在esmloader.import(节点:内部/模块/ESM/LOADER:276:22) 在ImportModuledynemallynymanically(节点:内部/模块/CJS/LOADER:1041:29) 在ImportModuledynemallyallyallywrapper(节点:内部/VM/模块:437:21) 在ImportModuledysnemallyaly中(节点:VM:381:46) 在importModuledynemallycallback(节点:内部/process/esm_loader:35:14) 在importPostcssconfigfile(e:\ team ### niledashboard \ nile-dashboard \ nile-dashboard \ node_modules \ esbuild-style-plugin \ dist \ dist \ index.js:76:22){ 代码:'err_unsupported_esm_url_scheme' } x [错误] [插件Esbuild-style-Plugin] Postcss配置文件在e:... \ Postcss.config.js无法加载。

当我在Windows中启动React应用程序时,我会收到此错误(x [error] [插件Esbuild style-plugin] Postcss config file at e:... \ Postcss.config.js无法加载。错误[ERR_UNSUPPORTED_ESM_URL_SCHEME]:默认的ESM加载程序仅支持文件和数据URL。 )。 我认为该项目是在Mac OS上配置的。 节点版本16.13.1

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol
'e:'
at new NodeError (node:internal/errors:371:5)
at defaultResolve (node:internal/modules/esm/resolve:1016:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ESMLoader.import (node:internal/modules/esm/loader:276:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1041:29)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:21)
at importModuleDynamically (node:vm:381:46)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
at importPostcssConfigFile (E:\Team###NileDashboard\nile-dashboard\node_modules\esbuild-style-plugin\dist\index.js:76:22) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
...

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol
'e:'
at new NodeError (node:internal/errors:371:5)
at defaultResolve (node:internal/modules/esm/resolve:1016:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ESMLoader.import (node:internal/modules/esm/loader:276:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1041:29)
at importModuleDynamicallyWrapper (node:internal/vm/module:437:21)
at importModuleDynamically (node:vm:381:46)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
at importPostcssConfigFile (E:\Team###NileDashboard\nile-dashboard\node_modules\esbuild-style-plugin\dist\index.js:76:22) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
X [ERROR] [plugin esbuild-style-plugin] PostCSS config file at E:...\postcss.config.js can't load.

when I npm start my react app in windows, I got this error(X [ERROR] [plugin esbuild-style-plugin] PostCSS config file at E:...\postcss.config.js can't load. and also this Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows10, absolute paths must be valid file:// URLs.
).
I think this project was configured on mac os.
node version 16.13.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咿呀咿呀哟 2025-01-27 22:40:28

无法代表 Windows,但我能够通过

  1. 使用 NvmNode 更新到更高版本

来解决 Linux 系统上的相同错误- 如何使用nvm正确升级节点

-- 如何安装或使用 nvm 更新节点

  1. 通过以下命令更新 pm2 正在运行的节点版本:

pm2 reload app --update-env

-

有关它的更多信息:

pm2 list 将显示 pm2 正在运行的应用程序,例如假设您只运行一个名为 app

pm2 show app 将显示 pm2 正在使用哪个 Node 版本。在输出中,您可能会看到

node.js version │ 14.20.0

使用 nvm 更新您的 node 版本后,您需要运行

pm2 reload app --update-env 应该更新 pm2 在此过程中使用的节点版本。

Cannot speak for Windows, but I was able to resolve this same error on my Linux system by

  1. using Nvm to update Node to a later version

-- How to properly upgrade node using nvm

-- How To Install or Update Node by Using nvm

  1. updating the version of node that pm2 was running, by the following command:

pm2 reload app --update-env:

-

More information about it:

pm2 list will show the apps pm2 is running e.g. suppose you're only running one, named app

pm2 show app will show you which Node version pm2 is using. In the output you may see

node.js version │ 14.20.0

After updating your node version with nvm, you need to run

pm2 reload app --update-env which should update the version of node that pm2 is using with this process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文