无法安装babel-cli

Dio*_*oso 3 javascript node.js babeljs

我在尝试运行时遇到错误:

$babel-node ./server.js

CLI已移至包中babel-cli.

$ npm install -g babel-cli
Run Code Online (Sandbox Code Playgroud)

当我安装它并再次运行它再次询问它.有人遇到过这种情况吗?似乎无法前进.

>

 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
Run Code Online (Sandbox Code Playgroud)

Bas*_*ber 6

Babel Version 6 拆分了一些包.

  1. 你试图打开新的终端窗口之后 npm install -g babel-cli
  2. 您也可以安装版本5并像以前一样工作: npm install -g babel@5
  3. 如果在升级节点后发生这种情况,请尝试npm rebuild在项目目录中
  4. 另一种解决方案是删除node_modules文件夹,然后npm install再次执行

  • 像魅力一样工作=)"npm rebuild"做到了! (2认同)