我想安装babel(windows)。但出现错误。如何解决?
Staff ~/Desktop/react
$ npm install --save-dev babel-core babel-loader babel-present-react
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/babel-core failed, reason: getaddrinfo ENOTFOUND proxy.company.com proxy.company.com:8080
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Staff\AppData\Roaming\npm-cache\_logs\2019-07-05T09_55_48_364Z-debug.log
答案 0 :(得分:0)
首先,Babel是一个工具链,主要用于在当前和较旧的浏览器或环境中将ECMAScript 2015+代码转换为JavaScript的向后兼容版本。
因此,首先需要安装node js,然后安装npm软件包管理器。
然后使用以下命令安装babel:npm install --save-dev @ babel / core @ babel / cli
,或者如果您想安装React,则可以使用“ npm Create-React-App”来创建单页React应用程序,这是一种官方支持的方式。通过Facebook