How to install an npm package from GitHub directly?

后端 未结 15 2073
失恋的感觉
失恋的感觉 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:40

    You can directly install an github repo by npm install command, like this: npm install https://github.com/futurechallenger/npm_git_install.git --save

    NOTE: In the repo which will be installed by npm command:

    1. maybe you have to have a dist folder in you repo, according to @Dan Dascalescu's comment.
    2. You definitely have to have a package.json in you repo! which I forget add.

提交回复
热议问题