Not able to rename the file ::Open Source, Lab 1 – Open Source Sneak Peek

Ques no 16 :: Not able to change the file
1. cd into src/components directory.
2. You will find a file named OpenLearnerCard.js
3. Open the file using any editor like vi or vim i.e vi OpenLearnerCard.js .
4. Go ahead and change the name John Peter to Bob Parker
image|355x500

Hi @prabal-pratap

What do you mean you can’t change it? Assuming you did the previous questions correctly and cloned the gitea repo, then you should be able to simply do

cd src/components
vi OpenLearnerCard.js

Find John Peter and edit to Bob Parker.
Save and exit

Hi @Alistair_KodeKloud, I have done vi OpenLearnerCard.js, also gone to insert mode but i am not able to find John Peter, there is nothing on that. It seems, that file is empty.

If vi is showing empty screen, you are not in the correct directory. It thinks you want to create a new file with that name.

If you enter pwd at the command prompt, you should get

/root/open-learner-card/src/components

Anything else and you’re in the wrong directory.

Ok, lets start from Q13

  1. Go to Gitea site by pressing Gitea button above console. Sign in with given credentials. Select the repo by clicking john/open-learner-card link. Get the gitea URL by pressing the copy button
    image
  2. Now back in the terminal, clone the repo
    git clone the_url_you_copied_in_step_13
    
  3. install dependencies
    cd open-learner-card
    npm install
    
  4. Let’s make changes to the project source code now
    cd src/components
    vi OpenLearnerCard.js