I am new for nodejs. I have package.json like this
{
...
"peerDependencies": {
"react": "16.0.0"
},
"dependencies": {
"some-lib-that-use-old-react": "git+ssh://git@bitbucket.org/xx/somelib.git",
"other-lib-that-use-old-react": "git+ssh://git@bitbucket.org/xx/other.git"
},
...
}
After I run npm install
I get project tree like this
node_modules
|
|__some-lib-that-use-old-react
|__other-lib-that-use-old-react
|__react
I use peerDependencies because do not need react
in some lib
and other lib
(It work right that I expected)
But the version of react is not 16.0.0
. It is old version from other lib.
Can I get react 16.0.0 with peerDependencies
?
I want one place of lib that I will use peerDependencies
instead of dependencies
.
I already try with npm-shrinkwrap.json
like this
{
"dependencies": {
"react": { "version": "16.0.0", "from": "react@16.0.0" }
}
}
But It is not work right with This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0.
I use npm 5.5.1 & node 8.9.3
. And do not have package-lock.json
before install.
Thank everyone for come to help.
Update 1 I change OS from mac to windows but It does not work, too. npm cache clean --force
not help, too.
Update 2 In package.json of react after npm i
It look like this
{
"_from": "react@old-version",
"_id": "react@old-version",
...
"_requiredBy": [
"/some-lib-that-use-old-react",
"/other-lib-that-use-old-react"
],
...
"version": "old-version"
}