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文件关联失败,无法打开目标文件 #33

Open
YxxY opened this issue Aug 25, 2017 · 2 comments
Open

windows文件关联失败,无法打开目标文件 #33

YxxY opened this issue Aug 25, 2017 · 2 comments

Comments

@YxxY
Copy link

YxxY commented Aug 25, 2017

最后生成的目标文件打开时,windows提示未创建关联,我分别尝试了用chrome关联html和js,系统仍旧弹框无法打开文件,只有每次去复制命令行里的url。有时候复制粘贴还总是不生效……气得我去看了下源码
var open = require('open')
...
function open_html_file(filename) {
open(filename)
return true
}
看到也是调用第三方包open我就懒得折腾了,直接搜了下如何将字符串复制粘贴至剪切板,于是增加了一行下面代码,失败就失败吧,总算没那么痛苦了。
require('child_process').spawn('clip').stdin.end(filename);

@Jianru-Lin
Copy link
Owner

@YxxY 哈哈,我的锅,很抱歉。不过最近太忙,有本书要交稿,来不及改了。以前我在 Windows 环境下是正常的,可以弹出。你的是 Windows 10 还是?是使用 cmd 还是 powershell、cygwin shell 或者别的?

@YxxY
Copy link
Author

YxxY commented Aug 30, 2017

@Jianru-Lin win7 cmd 和powershell 都不行

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