$ babel and $ babel-node don't launch the REPL

后端 未结 2 365
猫巷女王i
猫巷女王i 2021-01-27 17:25

I\'m trying to setup babel on Ubuntu 14.04 but it doesn\'t seem to be working!

Here are some outputs that may be required:

$ which node
/usr/sbin/node
$          


        
相关标签:
2条回答
  • 2021-01-27 17:56

    The /usr/sbin/node vs /usr/bin/nodejs issue has been covered in Cannot install packages using node package manager in Ubuntu but basically Ubuntu has a separate node package that is NOT Node.js. The package for Node.js on Ubuntu is called nodejs. If you have both installed, it means your scripts will try to run using the other unrelated application. One option is to symlink nodejs to node.

    The best solution however would be to use something like nvm to install node for your user without installing it globally. Then you can install and update node versions extremely easily, and your PATH will always reference node properly.

    0 讨论(0)
  • 2021-01-27 18:10

    Changing node to nodejs in the first line of /usr/local/bin/babel-node and /usr/local/bin/babel solves it.

    0 讨论(0)
提交回复
热议问题