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

egg-view-assets1.8.1版本,dev_server.js文件中对于win32环境下,env.PATH的路径错误写法 #44

Closed
ljj0915 opened this issue May 16, 2023 · 2 comments

Comments

@ljj0915
Copy link
Contributor

ljj0915 commented May 16, 2023

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

1.我的机器是window,然后Egg项目中引入了egg-view-assets,版本1.8.1,并设置了相关的命令参数:
config.assets = {
publicPath: '/public',
devServer: {
command: 'cross-env UMI_ENV=dev umi dev --port=8007',
port: 8007,
env: {
APP_ROOT: appInfo.baseDir,
BROWSER: 'none',
ESLINT: 'none',
SOCKET_SERVER: 'http://127.0.0.1:8007',
PUBLIC_PATH: 'http://127.0.0.1:8007',
},
},
};
2.也就是跑cross-env命令去启动umi。但是启动后,会提示:cross-env命令找不到的错误。
3.跟进下来发现,egg-view-assets这个文件中,startAsync()的启动中,有一个Path的拼接过程。
4.env.PATH = ${this.app.config.baseDir}/node_modules/.bin:${env.PATH};,这里面用的是“/”,这是linux的写法。windowx环境下应该使用 \ 来代替(两个\)

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

https://github.com/eggjs/egg-view-assets/blob/master/lib/dev_server.js

Node 版本号:

16.14.0

Eggjs 版本号:

2.36.0

相关插件名称与版本号(PlugIn and Name):

egg-view-assets: 1.8.1

操作平台与版本号(Platform and Version):

Window10 专业版 21H2

@fengmk2
Copy link
Member

fengmk2 commented May 16, 2023

eggjs/egg#5186 重复了,感谢反馈,尽快修复。

@fengmk2 fengmk2 closed this as completed May 16, 2023
@ljj0915
Copy link
Contributor Author

ljj0915 commented May 16, 2023

麻烦了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants