This community-built FAQ covers the “npm init” exercise from the lesson “Browser Compatibility and Transpilation”.
Paths and Courses
This exercise can be found in the following Codecademy content:
FAQs on the exercise npm init
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!
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!
Hi to everyone!
I’m using a Firefox browser.
I have “Nodejs” installed on my pc.
I was doing exercise 2 but I didn’t understand the instruction
" Use npm to create a new package.json file. We recommend you set the
description properties to the following values:
ls into the terminal to see the file structure of your current directory. Notice the addition of package.json .".
Generally I didn’t understand where is the project.Just on codecademy or, also, on my pc?
npm init in the terminal and continue seting the properties.
question. how do I aces console on my pc? I’m using Vs Code but I can’t find a way to install node js because I don’t know how to find the console thing where you run programs.
Hi @purplebleaf the console is the bash terminal on the right hand side. You should not install node on your computer. rather use the one on codeacademy.
Though if you do want to install node on your computer you can use google for an explanation because this tutorial does not cover that
I believe this exercise is too straight-forward and lowly adaptable. Because many people reading this exercise are probably new to things such as terminals, code files and such, we can all get easily confused. I believe it would be proper for the site staff to adjust this part of the lesson to be calmer and easier to understand by novice people (like me).
I am stuck on this too. Can someone give me a screenshot of how to run this?
After entering “ls” to see the file structure in Step 1,
create a package.json file by entering “npm init” (which goes to Step 2).
In name property, enter “learning-babel” and press Enter.
Continue to set other properties or just press Enter to leave the properties blank.
Hi, Im very new on coding.
One question, when I write " npm install babel-cli -D" to the console and I run it the program says I should go to step number 2.
In order to enter: " npm install babel-preset-env -D" I don’t know exactly how to pass to the next line. If I enter Enter then it starts like runing a program witch I don´t understand. Could you help me with it?
Hi @board1016062662, that’s okay! That’s exactly what is supposed to be happening. The command
npm install babel-cli -D installs a command line package needed to use Babel to transpile your code from ES6 to ES5.
You will need to hit enter, wait until it finishes, and then enter the next command to install another package. Don’t worry it’s not actually affecting your computer in any way. It’s all in-browser.
I have an issue that nobody has touched on yet…
In step 2 it says: We recommend you set the
description properties to the following values:
thing is … the
If you see this:
name. This value will be used if you simply hit enter, but you should be able to type in different name.
If this does not work you can always change the
name later by opening
package.json file and changing the value assigned to
you cant. Ahh ok thanks my dude but the thing is Codecademy TELLS you to change the name in step 2, so you’re going to have millions of learners (emphasis on the word LEARNERS) spending like an hour at a time trying to figure out …how to change it! However, the exercise does pass you so … scratches head
I understand this (no need to use caps), but I am not able to reproduce this problem and this is the first time that I see a report of such problem. If this will repeat - I will investigate this problem and I will report this bug.
This is how it looks for me -> https://drive.google.com/file/d/1dgw72yrnK8ABFbwNQ6V_QJK_ly1UGXv5/view.
Ok thank you so much @factoradic apologies for the caps, just wanted to add emphasis to my wording, thanks again bro.
You’re very welcome Nothing bad happened, no need to apologize, I understand now
What do I enter to complete TASK - Run
ls in the terminal to see the file structure of your current directory.
I started learning programming with javscript lesson on codecademy. However in this lesson I encountered vocabs like root directory, Node, that I haven’t learned previously. Are there lessons on codecademy that teaches what these are?
Intro to JS
lesson 5 of 11
Transpilation with Babel
How do i get to ./lib/main.js? If I type this into the terminal I get permission denied?
On Lesson 6 of 11, I am really lost. When I type ls here it tells me I am in the scr directory? How do I fine where the file is and move it?