Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

The package I published on npm is not installing without --force #339

Open
Elson0509 opened this issue Apr 9, 2021 · 1 comment
Open

Comments

@Elson0509
Copy link

I published my first npm package https://www.npmjs.com/package/lancelot-animated-buttons for react.js. This is the link for the Github https://github.com/Elson0509/lancelot-animated-buttons. However, It is only installed in a new react project when I use 'npm i lancelot-animated-buttons --force'. If I don't add --force, the following error shows up:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: project_react@0.1.0      
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from lancelot-animated-buttons@1.0.6
npm ERR! node_modules/lancelot-animated-buttons
npm ERR!   lancelot-animated-buttons@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\elson\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\elson\AppData\Local\npm-cache\_logs\2021-04-09T14_00_16_778Z-debug.log

This is the package.json of my npm package:

{
  "name": "lancelot-animated-buttons",
  "version": "1.0.5",
  "description": "Animated buttons for React.js",
  "author": "Elson Ramos",
  "license": "MIT",
  "key":["animated","buttons","react.js","ellipsis","hamburguer"],
  "repository": "elson_ramos/lancelot-animated-buttons",
  "main": "dist/index.js",
  "module": "dist/index.modern.js",
  "source": "src/index.js",
  "private": false,
  "engines": {
    "node": ">=10"
  },
  "scripts": {
    "build": "microbundle-crl --no-compress --format modern,cjs",
    "start": "microbundle-crl watch --no-compress --format modern,cjs",
    "prepare": "run-s build",
    "test": "run-s test:unit test:lint test:build",
    "test:build": "run-s build",
    "test:lint": "eslint .",
    "test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
    "test:watch": "react-scripts test --env=jsdom",
    "predeploy": "cd example && npm install && npm run build",
    "deploy": "gh-pages -d example/build"
  },
  "peerDependencies": {
    "react": "^16.0.0"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.3",
    "cross-env": "^7.0.2",
    "eslint": "^6.8.0",
    "eslint-config-prettier": "^6.7.0",
    "eslint-config-standard": "^14.1.0",
    "eslint-config-standard-react": "^9.2.0",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-node": "^11.0.0",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-react": "^7.17.0",
    "eslint-plugin-standard": "^4.0.1",
    "gh-pages": "^2.2.0",
    "microbundle-crl": "^0.13.10",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.0.4",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "^3.4.1"
  },
  "files": [
    "dist"
  ],
  "dependencies": {
    "aphrodite": "^2.4.0",
    "prop-types": "^15.7.2"
  }
}

I would like to be able to install this package without --force. Someone can help me, please?

@rap0so
Copy link

rap0so commented May 21, 2021

Have you tried update the react version of your package to 17.0.2?
Here "react": "^16.13.1",
and "react": "^16.0.0"

btw, is it necessary to have it twice?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants