ecmascript-6 - babel-node 不被识别为内部或外部命令、可运行程序或批处理文件

标签 ecmascript-6 babeljs

当我尝试通过 babel 命令运行 JS 文件时,它显示:

"babel-node is not recognized as an internal or external command, operable program or batch file".

我在这个书面“console.log(“hello world”)”中创建了1.js文件; 并尝试使用 babel-node 命令运行,但显示上述错误。

最佳答案

你可以尝试安装babel的全局版本

npm install -g babel-cli

关于ecmascript-6 - babel-node 不被识别为内部或外部命令、可运行程序或批处理文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42001054/

相关文章:

javascript - 如何在对象状态 react 中删除对象数组

javascript - typescript : SyntaxError: Unexpected token 'export'

javascript - Electron react 应用程序

gulp - 在 gulp 中使用 browserify-css

javascript - ES6箭头函数TypeError : Cannot read property '1' of null with multiple params using Karma

javascript - 如何在 ES6 中获取 Set 的第一个元素(EcmaScript 2015)

javascript - 由于 "undefined is not a function"un-polyfilled 函数,简单的 babel.js 独立测试在 Chrome v40 中不起作用

reactjs - 无法将 Hooks 与我的 React 组件库一起使用。不变违规 : Invalid hook call

javascript - 如何将 JSON 数据映射到类

javascript - ES6 - `document` 未定义