我是 Node.js 的新手,所以让我解释一下我想要做什么:
我要安装tail-http https://www.npmjs.com/package/tail-http在这个页面中,它清楚地表明它正在运行:
tail-http http://example.com/some-file.log
安装 Node 和 npm 后,我无法安装它并将其用作新命令,我得到的结果是:
$ npm init
$ npm install tail-http
$ cd node_modules
$ cd tail-http
$ node index.js http://example.com/some-file.log
这可行,但与该网络上公开的简单用法相去甚远。
我错过了什么?
最佳答案
npm install -g tail-http
将在全局范围内安装它,然后您可以在任何地方使用它。
关于javascript - 从命令行使用 Node.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40716253/