Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows下引入模块失败 #121

Closed
hezhengxu2018 opened this issue Jun 12, 2023 · 0 comments
Closed

windows下引入模块失败 #121

hezhengxu2018 opened this issue Jun 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hezhengxu2018
Copy link

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

Nodejs的require.resolve不支持windows格式的路径地址

const pkgJson = path.join(moduleReferenceConfig.package, 'package.json');

比如

requier.resolve("cnpmcore\\common\\package.json")

会解析失败
需要统一转换成linux的路径格式,如:

requier.resolve("cnpmcore/common/package.json")

可复现问题的仓库地址(Reproduction Repo)

const pkgJson = path.join(moduleReferenceConfig.package, 'package.json');

Node 版本号:

18.12.0

TEgg 版本号:

3.8.0

相关插件名称与版本号:

tegg-common-util

操作平台与版本号:

Windows11

@hezhengxu2018 hezhengxu2018 added the bug Something isn't working label Jun 12, 2023
killagu added a commit that referenced this issue Jun 28, 2023
github-merge-queue bot pushed a commit that referenced this issue Jun 28, 2023
@killagu killagu closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants