6

I'm having trouble installing babel-node

npm i -g babel-node

> babel-node@6.5.2 postinstall /Users/.../.../node_modules/babel-node
> node message.js; sleep 10; exit 1;

/Users/.../.../node_modules/ssh-key-to-pem/index.js:210
    throw new Error('Only RSA and DSA public keys are allowed');
    ^

Error: Only RSA and DSA public keys are allowed
Timmerz
  • 6,090
  • 5
  • 36
  • 49
  • FYI This package is almost certainly malicious and is typo-squatting babel-cli in order to exfiltrate people's SSH keys, you were saved by the fact that you use non RSA/DSA keys. I've reported it to NPM in the hopes that they remove it. – Nick Sweeting Aug 18 '19 at 23:37

1 Answers1

14

I solved this...it's not intuitive. I'll leave this up in case someone else runs into this issue.

npm install --save-dev babel-cli

https://babeljs.io/docs/usage/cli/

Timmerz
  • 6,090
  • 5
  • 36
  • 49
  • 1
    I'd like to point out that the full answer is: The command `babel-node` is *not* provided by the package `babel-node` (which is a [mock package](https://www.npmjs.com/package/babel-node/v/6.5.2)) but rather by the package `babel-cli` and *that's* why installing it solves the issue. Plus, if you already saved `babel-node` to your `package.json`, remove it. – neo post modern Oct 09 '18 at 22:21