10:Browser Compatibility and Transpilation step 8/11


#1

https://www.codecademy.com/courses/learn-javascript-transpilation/lessons/browser-compatibility-and-transpilation/exercises/babelrc?action=lesson_resume&course_redirect=introduction-to-javascript

first instruction was successfully run
touch .babelrc

I am not sure what to do in second instruction . How to add add an object that specifies the preset to “env”?


#2

Meh. I edited the file from the terminal and it refused to pass until I opened it in the editor. Worse yet is that it has to match what the course author anticipated:

if (Components.CodeEditor.codeContains('.babelrc', /\{(.|\n)*("|')presets("|')\s*\:(.|\n)*\[\s*('|")env("|')\s*\](.|\n)*\}/)) {
    return { pass: true };
}

…But then again, all there really is to it is to read the instructions, because they say what to do, even shows exactly what the content in that file should be.


#3

There is an folder icon left to the main.js title in the middle block, there you find the .babelrc file. Took me 20 minutes to find it as well. The rest should work easily.


#4

i found the folder, thanks for pointing to it but now it says command not found.
touch .babelrc
$ .babelrc {“presets”: [“env”]}
bash: .babelrc: command not found
$ {“presets”: [“env”]}
bash: {presets:: command not found
$ {“presets”:[“env”]}
bash: {presets:[env]}: command not found
$


#5

You were supposed to edit a file


#6

oh OKay. I have added the text in file .babelrc.
Thank you very much.
(mystery solved)


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.