npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm is deleting package randomly when installing unrelated package

reinstalling package eslint-config-airbnb

What Happened Instead

it was installed successfully but removed 362 packages along with it

Reproduction Steps

  1. npm i
  2. npm i eslint-config-airbnb
    • output:

> husky@1.3.1 preuninstall /Users/coder/rqiim-repos/rqiim/node_modules/husky
> node husky uninstall

husky > uninstalling git hooks
husky > done
npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-router-scroll-4@1.0.0-beta.1 requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@16.1.0 requires a peer of eslint@^4.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@12.1.0 requires a peer of eslint@^4.9.0 but none is installed. You must install peer dependencies yourself.

+ eslint-config-airbnb@16.1.0
removed 362 packages, updated 5 packages and audited 32263 packages in 58.744s
found 74 vulnerabilities (28 low, 26 moderate, 20 high)
  run `npm audit fix` to fix them, or `npm audit` for details
  1. ./node_modules/.bin/eslint ./server/index.js
    • output :

ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-mocha". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-mocha is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-mocha@latest --save-dev

Path to ESLint package: /Users/coder/rqiim-repos/rqiim/node_modules/eslint

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
  1. conclusion : missing package eslint-plugin-mocha

$ ls node_modules/eslint-plugin-
eslint-plugin-import/   eslint-plugin-jsx-a11y/ eslint-plugin-react/    

Details

Package.json:

{
  "name": "****",
  "version": "0.0.0",
  "main": "server/index.js",
  "sideEffects": [
    "*.scss",
    "*.css",
    "*.sass",
    "./node_modules/moment/locale/ar.js",
    "./client/src/core/config/axiosConfig.js",
    "./node_modules/bootstrap/dist/js/bootstrap.js",
    "./client/src/core/config/google-analysis.js",
    "./client/src/core/jquerFun.js",
    "./client/src/core/config/facebook-pixel.js",
    "./node_modules/lazysizes.js"
  ],
  "dependencies": {
    "@babel/cli": "7.0.0",
    "@babel/core": "7.0.0",
    "@babel/node": "7.0.0",
    "@babel/plugin-proposal-class-properties": "7.4.0",
    "@babel/plugin-proposal-decorators": "7.0.0",
    "@babel/plugin-proposal-export-namespace-from": "7.0.0",
    "@babel/plugin-proposal-function-sent": "7.0.0",
    "@babel/plugin-proposal-json-strings": "7.0.0",
    "@babel/plugin-proposal-numeric-separator": "7.0.0",
    "@babel/plugin-proposal-object-rest-spread": "7.4.3",
    "@babel/plugin-proposal-throw-expressions": "7.0.0",
    "@babel/plugin-syntax-dynamic-import": "7.2.0",
    "@babel/plugin-syntax-import-meta": "7.0.0",
    "@babel/plugin-transform-async-to-generator": "7.0.0",
    "@babel/plugin-transform-runtime": "7.4.4",
    "@babel/polyfill": "7.4.3",
    "@babel/preset-env": "7.0.0",
    "@babel/preset-flow": "7.0.0",
    "@babel/preset-react": "7.0.0",
    "@babel/preset-typescript": "7.3.3",
    "@babel/register": "7.4.4",
    "@babel/runtime": "7.4.5",
    "@google-cloud/storage": "1.7.0",
    "@google-cloud/trace-agent": "3.5.2",
    "@google-cloud/translate": "2.1.3",
    "@graphql-codegen/add": "1.1.3",
    "@graphql-codegen/cli": "1.1.1",
    "@graphql-codegen/introspection": "1.1.1",
    "@graphql-codegen/typescript": "1.1.1",
    "@graphql-codegen/typescript-mongodb": "1.1.1",
    "@graphql-codegen/typescript-resolvers": "1.1.1",
    "@playlyfe/gql": "2.6.1",
    "@types/chai": "4.1.7",
    "@types/chai-as-promised": "7.1.0",
    "@types/ejs": "2.6.3",
    "@types/graphql": "14.2.0",
    "@types/jsonwebtoken": "8.3.2",
    "@types/lodash": "4.14.123",
    "@types/mocha": "5.2.7",
    "@types/mongoose": "4.7.45",
    "@typescript-eslint/eslint-plugin": "1.6.0",
    "animate.css": "3.7.0",
    "apollo-server-express": "2.4.8",
    "axios": "0.16.2",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "9.0.0",
    "babel-loader": "8.0.0",
    "babel-plugin-dynamic-import-node": "2.2.0",
    "babel-plugin-module-resolver": "3.1.3",
    "bcrypt": "1.0.3",
    "body-parser": "1.18.3",
    "bootstrap": "3.3.7",
    "bootstrap-sass": "3.3.7",
    "chai": "4.2.0",
    "chai-as-promised": "7.1.1",
    "chart.js": "2.7.3",
    "clean-webpack-plugin": "0.1.19",
    "cookie-parser": "1.4.3",
    "css-loader": "0.28.4",
    "cssnano": "4.1.8",
    "dataloader": "1.4.0",
    "date-and-time": "0.5.0",
    "ejs": "2.6.1",
    "elasticsearch": "13.3.1",
    "eslint-config-prettier": "6.0.0",
    "express": "4.16.4",
    "extract-text-webpack-plugin": "3.0.2",
    "fast-check": "1.15.1",
    "fb": "2.0.0",
    "feed": "1.1.1",
    "fg-loadcss": "2.1.0",
    "file-loader": "1.1.11",
    "googleapis": "33.0.0",
    "graphql": "14.1.1",
    "graphql-advanced-projection": "1.0.2",
    "helmet": "3.15.0",
    "html-webpack-plugin": "3.2.0",
    "id-shorter": "0.1.1",
    "image-webpack-loader": "4.6.0",
    "imagemin": "5.3.1",
    "imagemin-jpeg-recompress": "6.0.0",
    "imagemin-jpegtran": "6.0.0",
    "imagemin-mozjpeg": "8.0.0",
    "imagemin-pngquant": "7.0.0",
    "imports-loader": "0.8.0",
    "jest": "20.0.4",
    "jquery": "3.3.1",
    "jquery-ui": "1.12.1",
    "jsonwebtoken": "8.4.0",
    "lazysizes": "4.1.5",
    "lodash": "4.17.11",
    "mailgun-js": "0.22.0",
    "medium-editor": "5.23.3",
    "medium-editor-insert-plugin": "2.5.0",
    "mini-css-extract-plugin": "0.4.5",
    "minifier": "0.8.1",
    "mocha": "6.1.4",
    "mock-req-res": "1.1.1",
    "moment": "2.22.2",
    "mongoose": "4.11.3",
    "node-cache": "4.2.0",
    "node-sass": "4.11.0",
    "nodemailer": "4.6.8",
    "nodemon": "1.18.9",
    "on-headers": "1.0.1",
    "optimize-css-assets-webpack-plugin": "4.0.3",
    "passport": "0.4.0",
    "passport-facebook": "2.1.1",
    "passport-google-oauth20": "1.0.0",
    "passport-twitter": "1.0.4",
    "paypal-checkout": "4.0.235",
    "postcss-loader": "3.0.0",
    "postcss-preset-env": "6.5.0",
    "progressbar.js": "1.0.1",
    "promise-debug": "0.1.1",
    "prop-types": "15.5.10",
    "query-string": "5.1.1",
    "quick-hash": "1.0.4",
    "rangy": "1.3.0",
    "rate-limiter-flexible": "0.21.2",
    "react": "16.6.3",
    "react-code-splitting": "1.2.1",
    "react-core": "0.0.0",
    "react-dom": "16.6.3",
    "react-hot-loader": "4.0.1",
    "react-medium-editor-es6": "0.1.0",
    "react-phone-number-input": "2.2.14",
    "react-redux": "5.1.1",
    "react-router": "4.3.1",
    "react-router-dom": "4.3.1",
    "react-router-scroll-4": "1.0.0-beta.1",
    "react-transition-group": "1.2.1",
    "redux": "3.7.2",
    "redux-form": "7.4.2",
    "redux-logger": "3.0.6",
    "redux-thunk": "2.3.0",
    "regenerator-runtime": "0.11.1",
    "resolve-url-loader": "2.3.1",
    "sass-loader": "6.0.7",
    "sinon": "7.3.2",
    "sinon-chai": "3.3.0",
    "sitemap": "1.13.0",
    "slick-carousel": "1.8.1",
    "socket.io": "2.2.0",
    "socket.io-client": "2.2.0",
    "striptags": "3.1.1",
    "style-loader": "0.18.2",
    "terser": "3.14.0",
    "terser-webpack-plugin": "1.2.0",
    "twilio": "3.23.1",
    "typescript": "3.4.3",
    "uglifyjs-webpack-plugin": "1.2.4",
    "webpack": "4.28.2",
    "webpack-cli": "3.1.1"
  },
  "engineStrict": true,
  "engines": {
    "node": "v8.11.1",
    "npm": "5.6.0"
  },
  "config": {
    "unsafe-perm": true
  },
  "scripts": {
    "start": "./scripts/start",
    "build": "./scripts/build",
    "build.dev": "./scripts/build.for.dev",
    "postinstall": "npm run build",
    "webpack-dev": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config config/webpack/webpack.dev.js",
    "nodemon": "./node_modules/nodemon/bin/nodemon.js --ext js,ts,gql --exec babel-node --extensions '.ts,.js,.jsx' server/index.js --ignore server/http/public/ --ignore client/",
    "g-comp": "./scripts/g-comp.sh",
    "g-gql-ser": "./scripts/gen-gql-ser.sh",
    "g-entity": "./scripts/scfold.sh",
    "new-page": "./scripts/newPageReact.sh",
    "start.dev": "./scripts/start.dev.sh",
    "test": "export ENV=test && mocha --opts mocha.opts",
    "tsc": "tsc",
    "genTypes": "graphql-codegen --config graphql-codegen.yml && eslint --fix server/graphql/types/graphql-types.ts "
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run tsc"
    }
  },
  "private": true,
  "devDependencies": {
    "eslint": "5.16.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-config-airbnb-typescript": "2.0.0",
    "eslint-import-resolver-alias": "1.1.1",
    "eslint-plugin-import": "2.17.1",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-mocha": "5.3.0",
    "eslint-plugin-react": "7.12.4",
    "eslint-plugin-sinon": "0.2.0",
    "husky": "1.3.1",
    "nyc": "14.1.1",
    "webpack-dev-server": "3.1.14"
  }
}

Platform Info

$ npm --versions
{ raqiim: '0.0.0',
  npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '4',
  nghttp2: '1.33.0',
  node: '8.16.0',
  openssl: '1.0.2r',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.77',
  zlib: '1.2.11' }
$ node -p process.platform
darwin