How do I get git:(master) npm to run? zsh brings back "number expected"

Viewed 235

I'm new to coding and have been doing a few different tutorials here and there. Right now I'm doing JavaScript Full Course for Beginners by Amigoscode.

I got the git close from his repository to unpack,

Last login: Sat Sep 11 12:16:25 on tty

UserUser -MacBook-Pro ~ % git gh repo clone amigoscode/javascript
Git: ‘gh’ is not a git command. See ‘git - -help’. 

The most similar command is 
        gc
UserUser@-MacBook-Pro ~ % git repo clone amigoscode/javascript
Git: ‘repo’ is not a git command. See ‘git - -help’. 

The most similar commands are 
        grep 
        reflow
        remote 
        repack

UserUser@-MacBook-Pro ~ % git clone amigoscode/javascript 
Fatal: repository ‘amigoscode/javascript’ does not exist

UserUser@-MacBook-Pro ~ % git clone https://github.com/amigoscode/javascript.git
Cloning into ‘javascript’…
remote: Enumerating objects: 98, done. 
remote: Counting objects: 100% (27/27), done. 
Remote: compressing objects: 100% (27/27), done. 
Remote: Total 98 (Delta 16), reused 0 (delta 0), pack-reused 71 
Unpacking objets: 100% (98/98), done. 

but I cannot get the git: (master) npm to run.

My zsh brings back an error that says "number expected".

Last login: Sat Sep 11 12:52:07 on ttys000

~   git:(master) nom 
zsh: number expected 
    
    
~   git:(master) nom 
zsh: number expected 

I tried looking for a solution on Stack Overflow.
One post suggested closing the terminal window, but that did not work.

Has anyone encountered this issue?
How can I get the git: (master) npm to run?
I'm on macOS Catalina version 10.15.7, git version: 2.24.3 (Apple Git-128).

1 Answers

Note that git gh would not work indeed.
gh is a command on its own, the GitHub official CLI

To clone a GitHub repository with it, you would use gh clone (assuming gh was installed first):

gh repo clone https://github.com/cli/cli

No git in front of it.

If you clone https://github.com/amigoscode/javascript, you need then to cd to the javascript folder created by the clone operation, before trying npm.
Type first which npm to check that executable is part of your $PATH.

Note that git: (master) npm is not a command.


The OP ade confirms/explains in the comments:

I figured out what I was doing incorrectly and you are correct.
I was using the wrong command in the terminal.

Once I used the correct command (git clone) to download the repo, I was able to use the command 'npm intall' to install the correct npm version to install the dependencies and run 'npm run devserver' to connect to the localhost:3000 where the front end of tutorial was housed.

Related