npm publish 不包括我的所有文件 [英] npm publish isn't including all my files

查看:169
本文介绍了npm publish 不包括我的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm 发布了一个模块.它运行良好,但是当我从注册表安装它时,结果发现缺少某些文件.

I npm publish'd a module. It went up fine, but then when I installed it from the registry, it turned out to be missing certain files.

当我在模块的项目目录中运行 irish-pub 时,果然,输出没有列出这些文件名.

When I run irish-pub in my module's project directory, sure enough, the output doesn't list those filenames.

我已经检查过:

  • 我没有 .npmignore 文件.
  • 我确实有一个 .gitignore 但它只包含 /node_modules/
  • 丢失的文件是普通的 JS 文件,而不是 默认忽略
  • I do not have an .npmignore file.
  • I do have a .gitignore but this only contains /node_modules/
  • the missing files are normal JS files, not things that could be ignored by default

还有什么可以阻止他们?

What else could be blocking them?

推荐答案

问题是我在 package.json 中有一个 files 数组.如果存在,则只有指定的文件会被发布,其他所有文件都会被有效地忽略.

The problem was I had a files array in package.json. If this is present, then only the specified files get published, and everything else is effectively npmignored.

https://docs.npmjs.com/files/package.json

这篇关于npm publish 不包括我的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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