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 () 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 () below!
Agree with a comment or answer? Like () to up-vote the contribution!
"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?
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?
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.
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!
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.
Happened to me too. The solution is to create file .babelrc manually. Click on the folder icon next to the main.js. Next click on the files ..., create the New File called .babelrc and add an object shown in the code snippet. Voila! Problem solved.
But first of all be sure that you disabled all blocking extensions (if you have any) and content blocking features of your browser, to be able to finish all lessons successfully.
I’ve read all of these posts and experienced the same problem. Since I don’t have a computer background, I don’t know how to “disable all blocking extensions” or any other potential “fixes”.
I deleted my browsing history and cache, reset the exercise multiple times, and continued to input the commands taught in the lesson. None of those things worked. Finally, I clicked “Reset Exercise” and, when it did, the “.babelrc” file magically appeared (without me even having to type “touch .babelrc” into the terminal window). Once that file appeared, I was finally able to finish the lesson.
My frustration is in the lack of response from CC moderators and staff in this forum. As you can see above, there are a myriad of frustrated students (myself included) who have paid a membership fee and should be getting some help from CC.
Is there another forum where CC moderators and staff might assist in resolving issues such as this? If anyone would point me in the right direction, it would be greatly appreciated. Thank you.
I did it the old school bash way of inserting text into a file by typing in the terminal
echo “{ \“presets\”: [\“env\”] }” >> .babelrc
The \" escapes the quotation marks so quotations are literally part of the text. Then I could use another code editor to place the brackets on an individual line.
If you type “ls -lah”, .babelrc will show up. It doesnt show up with ls becaus it is a hidden file. To edit it you can do “vi .babelrc” which opens the legendary command line editor. Editing through that method is a whole new challenge. I doubt that is how the makers of the exercise intended for it to be done, else they would have given a hint in the hint section.
After you type touch . babelrc to the right side of the screen you must click on the small folder icon next to where it says main.js on the left. You will see a drop down menu where one of the options is your .babelrc . Click on it and then type
{
“presets”: [“env”]
}
to the code editor
I had this question as well. From what I can gather in the babel documentation, the env preset takes your javascript code and passes it to babel plugins that will transpile. Still not 100% sure on what exactly is going on but this page reads:
Sidenote, if no targets are specified, @babel/preset-env will transform all ECMAScript 2015+ code by default.