FAQ: Browser Compatibility and Transpilation - Review

This community-built FAQ covers the “Review” exercise from the lesson “Browser Compatibility and Transpilation”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Introduction To JavaScript

FAQs on the exercise Review

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

/home/ccuser/.npm/_logs/2019
-01-24T21_02_30_247Z-debug.log

i get an error
Failed to parse package.json dat
a.
npm ERR! package.json must be actual JSON
, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix t
heir package.json file. JSON.parse

Are these command line tools only for Linux Terminal? Is there any way I can do it on other OS?

Hi there,
the installation of Babel to ./src/main.js and transpilation was ok and smooth. The same installation of Babel to the local workplace was not so even, because by creating package.json file to root dicrectory was automatically created another file package-lock.json. It probably makes impossible to go next step to create file .babelrc. What is the reason of package-lock.json happening and what is the solution there? Thanks

I submitted a bug report for the transpilation summary optional exercise page.
Just in case I did something wrong, here’s what I did:

Created a second javascript file (‘secondary.js’ in the ‘src’ directory
Re-ran NPM run build
What I expected to happen: Code in both main.js and secondary.js would be transpiled

What actually happened: CLI generated the expected message that each file had been copied/transpiled to the ‘lib’ directory. However, the only ‘main.js’ was transpiled correctly; ‘secondary.js’ only content was “use strict”; nothing more, even though identical code was in both source files. I suspect this may be a bug so reported it as such, if not, would love to know what I did wrong. Are all files required to be named ‘main.js’? I doubt it, because you can’t have more than one.

I think I solved my own problem; Refreshing the page now allows me to see the ‘secondary.js’ code which is now identical with ‘main.js’ transpilation. Still not sure why it does not do it without refreshing but I added an explanatory note to my bug report - I think.