Trouble With Learn JavaScript: Browser Compatibility and Transpilation 5/11


#1

Hi coders,

I am having some problems on Trouble With Learn JavaScript: Browser Compatibility and Transpilation 5/11. I am not sure what the instructions are telling me:

Instructions:

  1. In the terminal window type:

     npm install babel-cli
    

    This installs one of the two required Babel packages.

Um–so. Where do I copy in the code if my code runs:

Code:

  var pasta = "Spaghetti"; // ES5 syntax

  const meat = "Pancetta"; // ES6 syntax

 let sauce = "Eggs and cheese"; // ES6 syntax

 // Template literals, like the one below, were introduced in ES6
 const carbonara = `You can make carbonara with ${pasta}, ${meat}, and a sauce made with ${sauce}.`;

Would I copy in

npm install babel cli

below

const carbonara = `You can make carbonara with ${pasta}, ${meat}, and a sauce made with ${sauce}.`;

or somewhere else? :persevere: This is really confusing.

Well, thanks to anyone who can help!

Em


#2

npm is a package manager for JS packages, it can be run in the command line (the black window on the right hand side which says bash)

bash = borne again shell, its the default shell on many *nix based and derived platforms like linux, freeBSD and macOS.


#3

Oooooh. Thanks! I was wondering about the bash thingy.


#4

codecademy has a course on bash:

https://www.codecademy.com/learn/learn-the-command-line

and of course, plenty of information on bash and things like NPM exists on the internet

many webservers run Linux (or other unix systems), so understanding the environment you are working in, is pretty useful.


#5

Hmmm. Ok, I will check it out! Thanks for the info!