代码之家  ›  专栏  ›  技术社区  ›  user5047085

子包不包括在我的npm模块中

  •  0
  • user5047085  · 技术社区  · 8 年前

    我有一个名为“ldap池”的npm模块。此包依赖于“ldapjs”和“@types/ldapjs”,但由于某种原因,当我将“ldap pool”安装到另一个项目中时,没有安装“@types/ldapjs”包。 以上就是问题所在。

    包裹。“ldap池”的json文件如下所示:

    {
      "name": "ldap-pool",
      "version": "0.0.1011",
      "description": "LDAP client connection pool",
      "main": "index.js",
      "types": "index.d.ts",
      "typings": "index.d.ts",
      "scripts": {
        "test": "./@test.sh"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/ORESoftware/ldap-pool.git"
      },
      "keywords": [
        "ldap",
        "pool",
        "client",
        "connection",
        "ldapjs"
      ],
      "author": "Olegzandr VD",
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/ORESoftware/ldap-pool/issues"
      },
      "homepage": "https://github.com/ORESoftware/ldap-pool#readme",
      "dependencies": {
        "chalk": "^1.1.3",
        "ldapjs": "^1.0.1"
      },
      "devDependencies": {
        "@types/chalk": "^0.4.31",
        "@types/ldapjs": "^1.0.0",
        "@types/node": "^7.0.31"
      }
    }
    

    在另一个项目中安装ldap池时,我看到:

    enter image description here

    如果我将鼠标悬停在红色曲线上,我会看到:

    enter image description here

    有人知道为什么 ldapjs 我运行时不包括打字

    npm install

    ?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Ben    8 年前

    键入文件需要移动到ldap池包的依赖项部分。json。当模块用作依赖项时,不会下载模块的任何devdependency。

    ...
    "dependencies": {
      "chalk": "^1.1.3",
      "ldapjs": "^1.0.1",
      "@types/chalk": "^0.4.31",
      "@types/ldapjs": "^1.0.0",
      "@types/node": "^7.0.31"
    }
    ...
    
    推荐文章