FAQ: Browser Compatibility and Transpilation - Transpilation With Babel

Are npm install babel-cli, npm install babel-present-env something that will have to be run every time I want to convert a file or is it a one-time install that permanently makes my CLI capable of running npm run build to use Babel?

I am trying to complete the “Browser Compatibility and Transpilation” lesson and it fails every time. I have reset the lesson many times and carefully enter each step but at the end -> npm run build <- does not create the lib folder or do anything else.

1 Like

I’m confused are we suppose to actually install this in terminal as we do it in the terminal on the browser because I ran into issues on my mac.


Please help!
I’m not sure if these instructions are to install this on our computer or if this is just for the exercise

1 Like

i am so stuck even after going through the solutions in the comments. The issue here is that my terminal shows a bunch of errors after i put in “npm run build”. not sure why? is it bc im running windows?

2 Likes

are you running mac or windows? I tried this step by step and its not working, not creating the .lib/main.js folder, and my terminal looks diff from yours (getting all these errors when i put ‘npm run build’…any idea why?

so to add insult to injury this randomly worked after I refreshed a few times (been at this for an hour with 2 diff browsers) and it randomly worked after one of the many refresh and re-entering of the code in the terminal…any idea why by looking at my previous screenshots with the errors? very curious to learn how to save me time and aggravation next time

I’m using Mac. And Google Chrome.

I’m not an expert. But, I believe it’s something on their end (their environment). I experienced the same thing with command line lessons on CC. Once I successfully refreshed, the commands magically worked. Having dabbled with command line in my own environment (on my laptop), I’ve not experienced any similar issues. Glad you finally got it to work though!

Thankful for this post. Almost a year later and the instructions are still rubbish.

2 Likes

True. I just skipped this lesson and went on investigating on my own.

1 Like

I get the following error message when I start the lesson on “Babel Source Lib”

What did I do wrong? How do I move the .json file back to where it should be? Any help will be greatly appreciated.

has anyone experienced Not Found error when typing ‘npm install babel-preset-env’ in the .bash?

1 Like

Thank you runjaj2,

You should replace the guy who wrote this part of lessons :slight_smile:

2 Likes

Ok, so I get that not all browsers are ES6 compatible and that we may have to use Babel to get a ‘translation’ into an older language but how does this work in the real world?
When we eventually create our site, do we upload the converted older syntax alongside the new? Or just the old? How does that work practically?
Thanks in advance

I have been following the entire JavaScript lessons in order up until now.

However in MacOS Catalina in Terminal, typing npm install babel-cli results in

-bash: npm: command not found

There was never any discussion of prerequisites to have installed to do these lessons, or did I miss it?

Is this described somewhere? Why would you know this is supposed to exist and how to get it other than googling randomly?

to those confused (and probably understand what transpilation is) on how to start transpilation, please check out this resource. it has really helped me start from the basics and has intricate details on how to go about using Babel.

1 Like

on how to start transpilation, please check out this resource. it has really helped me start from the basics and has intricate details on how to go about using Babel.

on how to start transpilation, please check out this resource. it has really helped me start from the basics and has intricate details on how to go about using Babel.

thank you! :slight_smile:


No matter how long/hard I try. I can not successfully complete this task.

I even watched the help video and step-by-step ensured I was doing everything correctly.

Why can I not complete this!? :frowning:

1 Like