简体   繁体   English

"npm 包丢失文件夹"

[英]npm package missing folders

I've created an published a private npm package successfully.我已经成功创建了一个发布的私有 npm 包。 Here is the file structure:这是文件结构:

Library.Util
|
|__src
   |
   |__helper
      |
      |__typeChecker.js
|
|__index.js
|
|__package.json

We are facing the same issue, and are missing the src/ sub-directory when running a global install of an NPM package from our private NPM registry.我们面临同样的问题,并且在从我们的私有 NPM 注册表运行 NPM 包的全局安装时缺少src/子目录。

There is nothing referenced in the .npmignore or .gitignore files, and we are even explicitly referencing the src/ sub-directory in files block in the package.json : .npmignore.gitignore文件中没有任何引用,我们甚至在package.jsonfiles块中明确引用src/子目录:

{
...
  "main": "./bin/cli.js",
  "bin": {
    "app_name": "./bin/cli.js"
  },
  "scripts": {
    "start": "node ./bin/cli.js"
  },
  "files": [
    "bin",
    "test",
    "src",
    "package.json"
  ],
...
}

Interestingly the install also fails to install the test sub-directory, and moving the entry point to the src/ sub-directory results in it failing to install at all with the following error:有趣的是,安装也无法安装test子目录,将入口点移动到src/子目录会导致安装失败,并出现以下错误:

ENOENT: no such file or directory, chmod '...node_modules/@private_registry/app_name/src/cli.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM