我正尝试按照此 guy 通过 Babel 安装 ES6但我的终端机出错了。这是我在执行 npm install --global babel 后看到的
/usr/local/bin/babel -> /usr/local/lib/node_modules/babel/cli.js
/usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel/cli.js
/usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel/cli.js
babel@6.5.2 /usr/local/lib/node_modules/babel
当我输入 babel-node 时
You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.
npm uninstall babel
npm install babel-cli
See http://babeljs.io/docs/usage/cli/ for setup instructions.
当我尝试 npm uninstall babel 时,我得到了与以前相同的响应
最佳答案
使用这个。
npm install --global babel-cli
这将在全局范围内安装并完美运行。 并检查你的 package.json,是否在开发依赖下创建了 babel-cli 节点:
"devDependencies": {"babel-cli": "^6.14.0"}
关于javascript - Babel 安装无法通过 npm 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36657373/