FAQ: Browser Compatibility and Transpilation - .babelrc

Well done. This was the other post I needed after the walkthrough in the post by @kymberlicodes

I had no trouble completing the exercises, but when I tried to install Babel in my computer, the command ‘touch .babelrc’ does nothing. no .babelrc created anywhere.

I’ve tried using ‘touch babelrc’ (without the dot) and putting the dot after the file was created, but my Mac shows an error that I cannot start files with a dot.

Am I missing a setting somewhere?

Wow they really implied that I’d have to open it with the terminal.

1 Like

“Open .babelrc using the file explorer in the code editor. …”
UNIX has a file explorer? What tool is that? O.o/

I used vi editor – only editor I remember that exists on every *nix distro to make changes. Had to look up how to save. What a pain vi is for an infrequent user. Should have used nano like the other user here.

That little folder in the corner is not obvious. UI fail. (X.x)

thanks thats what i needed!

Thank you! You’e a lifesaver!

1 Like

Thanks, same for me.

Question: Both functionalities?

I’m currently starting a project locally to test these npm dependencies. I wonder. When i execute the app.js, will this turn completely into ES5 my code and ignore or remove the ES6? I didn’t catch if this is just like an option available in case the browser can’t read ES6, but will actually load my ES6 code by default? I mean, does it give you both functionalities, ES6 for newer version browsers and ES5 for older versions?

Wow- everything in this course has been well explained until this point, but this unit is driving me insane. I’m glad I was able to find the answer here- the instruction to “open the file” with no explanation of how to do so would have been an insurmountable stone wall for me otherwise.

1 Like

do you even script ?

touch .babelrc
echo "{\"presets\": [\"env\"]}" >> .babelrc
ls -a
cat .babelrc

however you still have manually open file explorer and click on .babelrc
click

1 Like

The most helpful. Thank you so much

Thanks it was going to take me like eternity to find it.

I created and edited the file using Vim on the terminal. That did not cause the tasks to be checked even though I could verify the file was there with the correct contents. I then ran touch .babelrc after the fact, and the first task was checked. The second task was checked when I used the folder navigation (as others have mentioned) to open the file and then clicked “Run”. Nothing in the file needed to be changed.

Hi, I am using git bash to use the command. It works with that. I was also able to create the file using my code editor.
From the things I tried, node.js doesn’t recognize the touch command. I tried looking for it but wasn’t able to find it.

For me the easiest way to create the file locally was using code editor. Hope this helps

thank you so much! It’s really easy to miss

If you’re on a Mac and trying to go through this same process on your computer, you have to create .babelrc through a code editor. It will say that the file will be “hidden” (because it starts with .), but it is in there.

I hope that might be helpful to someone else as it took me ages to figure it out!

I look for it for like 5 min straight and didn’t see it >.<

THANK YOU! Super helpful!

The fact that they didn’t explicitly say to click the folder icon or have had us actually interact with it at anytime before this… I guess that’s what you get for “free” lessons is almost no guidance at all lol

Worked so good for me