首页 > 解决方案 > npm 删除每次安装的依赖项

问题描述

每次我安装一个包时,节点都会删除一个依赖项。我目前使用的是 NPM 版本 6.13.4。我看到 2017 年在 github 上注意到了这个问题,但似乎没有得到解决。我可以安装的软件包数量是否有限制?这是我的 package.json:

{
  "name": "test",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www",
    "devstart": "nodemon ./bin/www -e js, pug",
    "serverstart": "DEBUG=test:* npm run devstart"
  },
  "dependencies": {
    "async": "^3.2.0",
    "aws-sdk": "^2.762.0",
    "bcrypt": "^4.0.1",
    "body-parser": "^1.19.0",
    "connect-redis": "^4.0.4",
    "cookie-parser": "^1.4.5",
    "debug": "~2.6.9",
    "dotenv": "^8.2.0",
    "express": "~4.16.1",
    "express-session": "^1.17.0",
    "express-socket.io-session": "^1.3.5",
    "express-validator": "^6.4.0",
    "fs": "0.0.1-security",
    "geojson": "^0.5.0",
    "http": "0.0.1-security",
    "http-errors": "~1.6.3",
    "moment": "^2.24.0",
    "mongoose": "^5.9.7",
    "morgan": "~1.9.1",
    "multer": "^1.4.2",
    "multer-s3": "^2.9.0",
    "node-geocoder": "^3.27.0",
    "nodemailer": "^6.4.11",
    "pug": "2.0.0-beta11",
    "redis": "^3.0.2",
    "socket.io": "^2.3.0",
    "striptags": "^3.1.1"
  },
  "devDependencies": {
    "nodemon": "^2.0.2",
    "stripe": "^8.102.0"
  }
}

标签: npm

解决方案


NPM 多年来一直存在这个问题。纱线似乎是一个不错的选择。


推荐阅读