'How to solve npm dependencies with other packages?

I have an angular app with these dependencies:

"dependencies": {
  "personalUiLibrary": "1.0.0"
},
"devDependencies": {
  "tailwindcss": "^2.2.7"
}

in personalUiLibrary package.json I have this devDependency:

"devDependencies": {
  "tailwindcss": "^2.2.7"
}

Into my angular app I need to update the tailwindcss version from 2.2.7 to 3.0.0 If i try to launch

npm i tailwindcss@latest

it goes well but I have an error:

Error: Can't resolve 'tailwindcss/lib/util/prefixNegativeModifiers' in 
'/myapp/node_modules/personalUiLibrary...'

Is there a way to have two versions of the same package into my package.json?



Solution 1:[1]

you can try using npm install --legacy-peer-deps - It tells NPM to ignore peer deps and proceed with the installation anyway

you can read more about how npm works internally here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guy Nachshon