react-native 启动报告:Error: UNKNOWN: unknown error, open ...\.babel.json [英] react-native start report: Error: UNKNOWN: unknown error, open ...\.babel.json

查看:97
本文介绍了react-native 启动报告:Error: UNKNOWN: unknown error, open ...\.babel.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 上有一个 RN 开发环境.它工作正常,直到昨天它在我运行react-native"启动后突然报告错误.错误信息:

I have a RN developing environment on Windows 7. It works fine until yesterday it suddenly reports error after I run "react-native" start. The error Message:

[2016-12-26 09:58:17]         HMR Server listening on /hot

React packager ready.

fs.js:557
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: UNKNOWN: unknown error, open 'C:\Users\xitao\.babel.json'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.writeFileSync (fs.js:1222:33)
    at save (C:\RN\LearnRN\node_modules\babel-register\lib\cache.js:45:16)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
fs.js:557
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: UNKNOWN: unknown error, open 'C:\Users\xitao\.babel.json'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.writeFileSync (fs.js:1222:33)
    at save (C:\RN\LearnRN\node_modules\babel-register\lib\cache.js:45:16)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
fs.js:557
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: UNKNOWN: unknown error, open 'C:\Users\xitao\.babel.json'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.writeFileSync (fs.js:1222:33)
    at save (C:\RN\LearnRN\node_modules\babel-register\lib\cache.js:45:16)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

我用谷歌搜索了错误,没有运气.我删除了 .babel.json,错误 stiil 出来了.我重新启动了一个新项目,还是一样.我卸载了 node.js 和 python,然后按照 RN 主页上的入门"再次安装它们,仍然相同.我安装了 react-native-cli 2.0.1 和 1.3.0,还是一样.

I google the error, no luck. I delete the .babel.json, the error stiil comes out. I reinit a new project, still the same. I uninstall node.js and python, then install them again follow the "Getting Started" on RN mainpage, still the same. I install react-native-cli 2.0.1 and 1.3.0, still the same.

看起来 RN 项目即使出现错误也能正常工作.但是你永远不知道这个错误什么时候会伤害到我的项目.

It seems the RN project works even with the error. But you never know when the error will hurt my project.

推荐答案

我的 node.js 版本是 7.5.0.

My node.js's version was 7.5.0.

我昨天更新到 7.10.0,问题解决了.

I updated it to 7.10.0 yesterday and the problem solved.

这篇关于react-native 启动报告:Error: UNKNOWN: unknown error, open ...\.babel.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆