Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies are not added but replaced #1

Closed
YuriGor opened this issue Dec 2, 2018 · 0 comments
Closed

dependencies are not added but replaced #1

YuriGor opened this issue Dec 2, 2018 · 0 comments

Comments

@YuriGor
Copy link
Contributor

YuriGor commented Dec 2, 2018

Expected Behavior

I expect npm-add-dependencies will add dependencies, but not replace them

Actual Behavior

when i try to add some packages to the existing package.json, all the packages already listed in the corresponding section (devDependencies) disappear, so newly added packages fully replace old list.

Steps to Reproduce the Problem

before

{
  "name": "1-end",
  "version": "0.0.1",
  "license": "MIT",
  "scripts": {
    "build": "next build",
    "start": "next start",
    "dev": "next",
    "lint": "eslint components pages lib"
  },
  "dependencies": {
    "@material-ui/core": "^3.3.1",
    "next": "^7.0.2",
    "prop-types": "^15.6.2",
    "react": "^16.6.0",
    "react-dom": "^16.6.0",
    "react-jss": "^8.6.1"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "eslint": "^5.7.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-react": "^7.11.1"
  }
}

command
npm-add-dependencies eslint-config-prettier eslint-plugin-prettier prettier --dev

after

{
  "name": "1-end",
  "version": "0.0.1",
  "license": "MIT",
  "scripts": {
    "build": "next build",
    "start": "next start",
    "dev": "next",
    "lint": "eslint components pages lib"
  },
  "dependencies": {
    "@material-ui/core": "^3.3.1",
    "next": "^7.0.2",
    "prop-types": "^15.6.2",
    "react": "^16.6.0",
    "react-dom": "^16.6.0",
    "react-jss": "^8.6.1"
  },
  "devDependencies": {
    "eslint-config-prettier": "^3.3.0",
    "eslint-plugin-prettier": "^3.0.0",
    "prettier": "^1.15.3"
  }
}

Specifications

  • Version: 0.1.2, npm 6.4.1
  • Platform: Ubuntu 18.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant