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

win10热编译报错 #2171

Closed
jyjey opened this issue Feb 14, 2019 · 5 comments
Closed

win10热编译报错 #2171

jyjey opened this issue Feb 14, 2019 · 5 comments

Comments

@jyjey
Copy link

jyjey commented Feb 14, 2019

问题描述
在使用"npm run build:h5 -- --watch"启动项目后,在代码中添加或删除一整行代码时热编译高概率报错

复现步骤
[复现问题的步骤]
使用npm run build:h5 -- --watch启动项目
修改任意文件添加一行代码例如console.log(123)
Ctrl+S 热编译就会报错

期望行为
正常热编译

报错信息

创建 发现文件 src\pages\my\css\setting.scss

修改 文件变动 src\utils\Operation.tsx
创建 添加文件 src\utils\Operation.tsx___jb_tmp___
fs.js:115
throw err;
^

Error: ENOENT: no such file or directory, open 'D:\workSpace\mall\src\utils\Operation.tsx___jb_tmp___'
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at processFiles (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\src\h5.js:804:19)
at FSWatcher.watcher.on.filePath (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\src\h5.js:843:7)
at FSWatcher.emit (events.js:189:13)
at FSWatcher. (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\node_modules\chokidar\index.js:199:15)
at FSWatcher._emit (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\node_modules\chokidar\index.js:241:5)
at FSWatcher.NodeFsHandler._handleFile (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\node_modules\chokidar\lib\nodefs-handler.js:294:10)
at FSWatcher. (C:\Users\ACE\AppData\Roaming\npm\node_modules@tarojs\cli\node_modules\chokidar\lib\nodefs-handler.js:495:21)
at FSReqWrap.oncomplete (fs.js:155:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:h5: taro build --type h5 "--watch"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:h5 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\ACE\AppData\Roaming\npm-cache_logs\2019-02-14T06_26_24_375Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev:h5: npm run build:h5 -- --watch
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev:h5 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\ACE\AppData\Roaming\npm-cache_logs\2019-02-14T06_26_24_402Z-debug.log

Process finished with exit code 1

系统信息
👽 Taro v1.2.2

Taro CLI 1.2.2 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.1 - D:\workTool\nodejs\node.EXE
Yarn: 1.13.0 - C:\Users\ACE\AppData\Roaming\npm\yarn.CMD
npm: 6.4.1 - D:\workTool\nodejs\npm.CMD

补充信息
taro 1.2.11也存在相同问题,win7中貌似没有这个问题

@taro-bot
Copy link

taro-bot bot commented Feb 14, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam
Copy link
Member

应该是你的编辑器的问题,生成了一个这样的文件 Operation.tsx___jb_tmp___

@jyjey
Copy link
Author

jyjey commented Feb 18, 2019

谢谢

@AvailCat
Copy link

AvailCat commented Feb 18, 2019

@jyjey JetBrains 系列 IDE 可以在 Settings -> Appearance & Behavior -> System Settings 中关闭 Use "safe write" 这个功能

@jyjey
Copy link
Author

jyjey commented Mar 6, 2019

感谢回答

@jyjey jyjey closed this as completed Mar 6, 2019
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

3 participants