Having Problems With NPM In Visual Studio Code: I BUILT AN NFT GAME IN 12 HOURS (Part 1) - Building the Ethereum Smart Contract

Hello! Iā€™m new to Moralis but I was trying to do the Youtube tutorial about making an NFT game in 12 hours. I downloaded Visual Studio Code, but when I opened up the terminal and typed: npm init
It gave me an error! Iā€™ve pasted it here:

npm : The term ā€˜npmā€™ is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1

  • npm init
  •   + CategoryInfo          : ObjectNotFound: (npm:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Please help because I would really like to start coding as soon as possible. Thanks!

Do you have node/npm installed?

If not start there

Itā€™s easy to assume every one has it installed, but perhaps this is your first time using things like JS. If so, welcome!

2 Likes

Hello thanks for responding. I installed Node.js using the link you provided but when I type ā€œnpm initā€ it gives me the same error as before.

Did you restart your editor after installing node?
Node works fine?

Hmm iā€™ll try restarting it.

Closed my editor, reopened it, tried ā€œnpm initā€ again, but I got the same error.

What is the exact error that you get now?

Here it is:

npm : The term ā€˜npmā€™ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1

  • npm init
  •   + CategoryInfo          : ObjectNotFound: (npm:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Do you know where on you system npm should be located?

Iā€™m not sure. Iā€™m using Visual Studio Code.

node ā€”version works?

What? Iā€™m not sure what you mean.

To test of node works, that command should print the version of node

So when I type ā€œnpm initā€ I have to specify the version of node?

No, I mean if you type only ā€˜node ā€”versionā€™ what you get, without npm

When I typed ā€˜node ā€”versionā€™ in the terminal it gave the same exact error as before.

That sounds like you donā€™t have node installed

1 Like

Weird. I installed it yesterday using the link @IntrepidShape provided me.