Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Node.JS Nodejs and Express

I'm beginning to learn JavaScript and determined that development is better with Nodejs. So, I got hold of "Jump Start Node.js" by Don Nguyen and started to work my way through it. I've installed Node.js on my Windows 10 system, organised a MongoDB on AWS, then I'm asked to do the following:

sudo npm install -g [email protected]

There was no indication whether this was to be done in Node or the command shell. I found that Node doesn't know what 'npm' is and the command shell doesn't know what 'sudo' is.

So, I'm lost. Can anyone help?
 
I'm beginning to learn JavaScript and determined that development is better with Nodejs. So, I got hold of "Jump Start Node.js" by Don Nguyen and started to work my way through it. I've installed Node.js on my Windows 10 system, organised a MongoDB on AWS, then I'm asked to do the following:

sudo npm install -g [email protected]

There was no indication whether this was to be done in Node or the command shell. I found that Node doesn't know what 'npm' is and the command shell doesn't know what 'sudo' is.

So, I'm lost. Can anyone help?
Hi there,

That is because sudo is a Unix/Linux based command to allow a user temporary admin/root privileges. Windows doesn't have that. You would have to right click the command prompt icon and select "run as administrator" and click on yes when the warning popup shows up.

Here's a very helpful guide on how to install node and npm on windows:

 
Thanks for the reply. When I right-click to run the command prompt as admin, enter the command and press enter, it responds with 'sudo' is not recognised as an internal or external command, operable program or batch file.
 
Thanks for the reply. When I right-click to run the command prompt as admin, enter the command and press enter, it responds with 'sudo' is not recognised as an internal or external command, operable program or batch file.
I think you misunderstood what I mentioned. I was saying that sudo, the command that gives a user temporary admin privileges, is not a Windows Batch/Command Prompt command. That is a command found in UNIX/Linux based systems. Windows way of getting privileges, is to right click on the icon and click on "run as administrator" and click ok on the warning pop up.
 

Attachments

  • 1698973621856.png
    1698973621856.png
    9.3 KB · Views: 4
Last edited:
Thanks Antero360...I did read your response. I said 'admin' as a shortcut to 'administrator' which I used.

As for your 'freecodecamp' insert...excellent! I followed it and have Node, npm and Express installed. I have a test package.json sitting in VS, is it executable?
 
Thanks Antero360...I did read your response. I said 'admin' as a shortcut to 'administrator' which I used.

As for your 'freecodecamp' insert...excellent! I followed it and have Node, npm and Express installed. I have a test package.json sitting in VS, is it executable?
It should be
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom