How to install an npm package from GitHub directly?

后端 未结 15 2307
失恋的感觉
失恋的感觉 2020-11-22 06:48

Trying to install modules from github results in:

ENOENT error on package.json.

Easily reproduced using express:

15条回答
  •  深忆病人
    2020-11-22 07:20

    Because https://github.com/visionmedia/express is the URL of a web page and not an npm module. Use this flavor:

    git+https://github.com/visionmedia/express.git
    

    or this flavor if you need SSH:

    git+ssh://git@github.com/visionmedia/express.git
    

提交回复
热议问题