This is a question from Linux Fundaments on HTB academy.
I’ve been stuck with question for a while now. I’ve search google and entered several answers that I can guess. But none of them worked.
Here is the question.
“Find a way to start a simple HTTP server using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number)”
Here is the hint for the question.
“Npm is a package manager that can allow you to download a basic web server packet. This packet also provides the option to specify the port. No need to install it. How would the command look after installing the corresponding package with a specified listening port?”
You can find the npm website about simplehttpserver here → https://www.npmjs.com/package/simplehttpserver .The command to start a webserver is simply “simplehttpserver [directory to be web root,default is the current working directory]”.Also to install simplehttpserver through npm “npm install simplehttpserver -g”.Hope it helps
This is a question from Linux Fundaments on HTB academy.
I’ve been stuck with question for a while now. I’ve search google and entered several answers that I can guess. But none of them worked.
Here is the question.
“Find a way to start a simple HTTP server using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number)”
Here is the hint for the question.
“Npm is a package manager that can allow you to download a basic web server packet. This packet also provides the option to specify the port. No need to install it. How would the command look after installing the corresponding package with a specified listening port?”
This gets asked a few times because IMHO it is a badly worded question. The answer doesn’t need npm.
It feels like any attempt to be more specific with an answer here gets flagged as a spoiler. This question gets asked a lot which implies people are struggling with it, but every thread is littered with Spoiler Removed messages.
Thanks m0j0r1s1n that link helped.
I think the issue with this question is that there has been no mention of this process in the module to this point which makes it pretty hard or someone with no linux knowledge to figure out the answer
RE: the way questions are asked
I am only on my first few modules, and I think the wording … really lacks.
The words used to ask questions do not match the words or phrases I have heard used before, and it really makes the academy frustrating.
As everyone seems to complain about this module, proves that I’m not missing something, the module is just bad. I wanted to pay to get access to the other courses but I’ll think again. 1h30 in, still haven’t found the answer btw. Frustrating.
Took me ages to work this out hint : forget about the npm bit , concentrate on what the command would look like assuming npm is already installed https://www.npmjs.com/package/http-server , look CAREFULLY at usage section
if it helps, this was my journey. And, annoyingly, i don’t fully understand how i solved the question so i’ve missed the point. i was trying to do this on the VM. I’d SSH’ed to ‘htb-student@host’ but I didn’t have the permissions to install npm on that machine. There is a line in the hint stating “No need to install it” so confusingly i was thinking that seeing as i do not have the permissions to install, i use the package without installing it… (!!!) Then, i just used my host VM - no SSH (on the host VM i had the privileges required). I played around and it worked but i don’t know how. I used this resource - i might have found it from someone elses post - i cant remember. I hope it helps… https://www.npmjs.com/package/http-server
Like has been said, don’t stress over the NPM so much…look at the actual command you’d use and go from there If A Little Knowledge Is A Dangerous thing, Learn, learn, learn and Become Very dangerous
Thank you. I have base knowledge of linux and have not used npm in over 20 years. i do not remember seing anything in the modules about npm and I tried so many things before giving in and searching the forums. Your assistance allowed me to figure it out in a couple minutes.
im new to linux and have no idea what ay of yall are talking about or how to navigate the links yall send. i started a server on port 8080 and checked it to make sure it was online with firefox. but it said that was the wrong answer