Answer the question
In order to leave comments, you need to log in
Why doesn't the npm install node-static command work?
I'm just getting into JS myself, moved on to the AJAX and COMET chapter in the Modern JavaScript Tutorial, where it says to put node-static in a directory to work with requests. I tried to figure it out myself, but it didn't work. Here is what the terminal outputs:
Answer the question
In order to leave comments, you need to log in
You put it in a directory without package.json this time. The installer swears, but still created node_modules.
This package is for installing a program, not a library, and must be installed "globally".
If you put it locally, then the call will simply static
give nothing, because there is no such executable file in the folders specified in PATH. You
can run it in the folder via npx static
or ./node_modules/.bin/static
, in the current folder, of course.
Well, it's better to put it globally, of course, through sudo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question