Y
Y
yostarlord2019-06-27 13:52:12
JavaScript
yostarlord, 2019-06-27 13:52:12

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:
7bb3a24b3591.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-06-27
@Xuxicheta

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 staticgive nothing, because there is no such executable file in the folders specified in PATH. You
can run it in the folder via npx staticor ./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 question

Ask a Question

731 491 924 answers to any question