FAQ: Browser Compatibility and Transpilation - .babelrc


#1

This community-built FAQ covers the “.babelrc” 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 .babelrc

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!


#2

"Open .babelrc using the file explorer in the code editor.

Add the following object to the file:

{
“presets”: [“env”]
}"

I am at a complete loss. I have been searching the directory in the code editor for over an hour and can find nothing like “.babelrc” listed. Where do I find it?


#3

" Your project directory contains the following folders and files:

project
|_ node_modules
|___ .bin
|___ ...
|_ src
|___ main.js
|_ .babelrc
|_ package.json

No it doesn’t. I have followed along with all the prompts from this section correctly (at least, I assume that I have since the tutorial has allowed me to progress as far as section 8 of this chapter). But I do not have have a layout akin to this in my root directory. I have the “node modules” and package.json" and “Main.js” but not “.babelrc” or “bin” or “…” Where am I going wrong?


#4

You could create it.

$ touch .babelrc

Just make sure it goes into the right directory, whichever that is. (the directory structure you posted shows how the project dir relates to the other dirs)

I don’t know about your files, but there’s a .babelrc in my home directory. It could be old, and I don’t know if babel would look there. Maybe. Might want to create it in your project directory like they suggest is where it should exist anyway.


#5

It took me a second to figure this out, but there’s a tiny little folder icon just to the right of the main.js tab in the middle of your screen. If you click that, after you run the $touch .babelrc, you should see the file browser they mention in the reading portion, and you’ll see .babelrc in there. If you do an ls on the directory, .babelrc will not show up. I hope this helps!


#6

I’m having the exact same problem. I’ve followed every instruction but when I go to the file directory the only file there is main.js. Out of curiosity I clicked the ‘show me solution’ button and checked the file directory again but it’s still just main.js; it allows me to move on to the next step but I’m at a loss as to why it isn’t working.