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

Npm i doesn't fix the dependencies while npm install does #53

Open
metacoding opened this issue Jan 22, 2022 · 2 comments
Open

Npm i doesn't fix the dependencies while npm install does #53

metacoding opened this issue Jan 22, 2022 · 2 comments

Comments

@metacoding
Copy link

Problem

It seems using the abbreviated form of npm install (i.e. npm i) doesn't force the resolution of packages.

example

original package.json file

{
  "name": "qubyte-website",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@headlessui/react": "^1.4.3",
    "@heroicons/react": "^1.0.5",
    "@reactpreview/cli": "^0.7.2",
    "daisyui": "^1.24.3",
    "next": "^12.0.8",
    "next-auth": "^4.1.2",
    "react": "17.0.2",
    "react-dark-mode-toggle": "^0.2.0",
    "react-dom": "17.0.2",
    "react-intersection-observer": "^8.33.1",
    "recoil": "^0.5.2"
  },
  "devDependencies": {
    "@types/node": "17.0.10",
    "@types/react": "17.0.38",
    "@types/three": "^0.136.1",
    "autoprefixer": "^10.4.2",
    "eslint": "8.7.0",
    "eslint-config-next": "^12.0.8",
    "postcss": "^8.4.5",
    "rimraf": "^3.0.2",
    "tailwindcss": "^3.0.15",
    "typescript": "4.5.5"
  }
}

Without resolutions section, and without npm-force-resolution the above dependencies will show the following output after executing npm install:
image

Now consider the following version of the package.json modified to use npm-force-resolution to fix the above error:

{
  "name": "qubyte-website",
  "private": true,
  "scripts": {
    "clean": "npm i rimraf -D && rimraf node_modules && npx npm-force-resolutions",
    "preinstall": "npm run clean",
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@headlessui/react": "^1.4.3",
    "@heroicons/react": "^1.0.5",
    "@reactpreview/cli": "^0.7.2",
    "daisyui": "^1.24.3",
    "next": "^12.0.8",
    "next-auth": "^4.1.2",
    "react": "17.0.2",
    "react-dark-mode-toggle": "^0.2.0",
    "react-dom": "17.0.2",
    "react-intersection-observer": "^8.33.1",
    "recoil": "^0.5.2"
  },
  "devDependencies": {
    "@types/node": "17.0.10",
    "@types/react": "17.0.38",
    "@types/three": "^0.136.1",
    "autoprefixer": "^10.4.2",
    "eslint": "8.7.0",
    "eslint-config-next": "^12.0.8",
    "postcss": "^8.4.5",
    "rimraf": "^3.0.2",
    "tailwindcss": "^3.0.15",
    "typescript": "4.5.5"
  },
  "resolutions": {
    "node-fetch": "^2.6.7"
  }
}

If I run npm i, at the end it will show the following output exactly similar the original one:
image

However if I run npm install I get the following output:
image

@WilliamHolmes
Copy link

Yep I still see the same issue. Using 0.0.10

@matheuscuba
Copy link

Same issue here, took me a while to realize this

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

3 participants