简体   繁体   English

无法安装 babel-cli

[英]Can't install babel-cli

I'm getting an error when trying to run:尝试运行时出现错误:

$babel-node ./server.js

The CLI has been moved into the package babel-cli . CLI 已移入包babel-cli

$ npm install -g babel-cli

When I install it and run it again it asks again for it.当我安装它并再次运行它时,它再次要求它。 Anyone came across this situation?有人遇到过这种情况吗? Can't seem to move forward.好像不能前进了。

> >

 npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v5.1.0
npm ERR! npm  v3.5.0
npm ERR! code ELIFECYCLE
npm ERR! relay-starter-kit@0.1.0 start: `babel-node ./server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the relay-starter-kit@0.1.0 start script 'babel-node ./server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the relay-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node ./server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls relay-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/diogo/Projects/cf-ophite/npm-debug.log

Babel Version 6 split some packages . Babel Version 6拆分了一些包

  1. Did you try to open a new terminal window after npm install -g babel-cli ?您是否尝试npm install -g babel-cli之后打开一个新的终端窗口?
  2. You can also install version 5 and work as before: npm install -g babel@5您也可以安装第 5 版并像以前一样工作: npm install -g babel@5
  3. If this happens after upgrading node, try npm rebuild in your project directory如果在升级节点后发生这种情况,请在项目目录中尝试npm rebuild
  4. Another solution is to delete the node_modules folder, and execute npm install again另一种解决方法是删除node_modules文件夹,再次执行npm install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM