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.