[英]babel-cli issues with npm
I am using babel to build a part of my library and I'm running into issues when i run babel commands through npm. 我正在使用babel构建我的库的一部分,当我通过npm运行babel命令时遇到了问题。
I have an npm script called build that calls: 我有一个名为build的npm脚本,该脚本调用:
{
"prebuild": "rm -rf && mkdir dist",
"build": "babel src/index.js -o dist/index.js"
}
I have run the actual babel command itself in my command line and it works. 我已经在命令行中运行了实际的babel命令,它可以工作。
However when I do npm run build from my command line it says 但是,当我从命令行运行npm运行build时,它说
The CLI has been moved into the package 'babel-cli'
npm also says that it is that specific line that is failing. npm还说是那条特定的线失败了。
I have already tried the following: 我已经尝试了以下方法:
Any other ideas? 还有其他想法吗? as to why npm fails at running this command? 关于为什么npm运行此命令失败?
全局安装babel@5
( npm install babel@5 --global
)以及本地npm install babel@5 --save-dev
: npm install babel@5 --save-dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.