npm安装没有package.json的git仓库 [英] npm install git repository without package.json

查看:709
本文介绍了npm安装没有package.json的git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的package.json如下所示:

 dependencies:{
vendor-name:git://github.com/vendor/name.git#v1.1,
...
}

只要 vendor-name repository包含一个 package.json



如果没有这样的文件,我得到:

  npm ERR!路径/var/folders/0l/temp-folder/package.json 
npm ERR!代码ENOENT

实际上, npm install git://github.com/ vendor / name.git#v1.1 也不起作用。

所以我的问题是:
有没有办法安装(包含)没有 package.json

的git存储库(在依赖关系中) >

解决方案

是的,您可以使用此包装: https://npmjs.org/package/napa


I have a project that depends on several third-party libs.

My package.json looks like:

"dependencies": {
    "vendor-name": "git://github.com/vendor/name.git#v1.1",
    ...
}

This works as long as the vendor-name repository contains a package.json.

If there's not such a file, I get:

npm ERR! path /var/folders/0l/temp-folder/package.json
npm ERR! code ENOENT

Actually, a npm install git://github.com/vendor/name.git#v1.1 does not work, too.

So my question is: Is there a way to install (include) git repositories (in the dependencies) that do not have a package.json?

解决方案

Yes you can with this package: https://npmjs.org/package/napa

这篇关于npm安装没有package.json的git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆