I have a project1 that already depends on styled-components@4.4.1
When I try to install the project2 as a lib in the project1 using npm install /my/project2/build, my package-lock.json is changed as the snipped showed bellow:
+ "projec2": {
+ "version": "file:/my/project2/build",
+ "requires": {
+ "styled-components": "4.4.1"
+ },
+ "dependencies": {1
+ "@babel/code-frame": {
+ "version": "7.16.7",
...
+ "requires": {
+ "@babel/highlight": "^7.16.7"
+ }
+ },
+ "@babel/generator": {
+ "version": "7.17.7",
...
+ "requires": {
+ "@babel/types": "^7.17.0",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ }
+ },
+ "@babel/helper-annotate-as-pure": {
+ "version": "7.16.7",
...
+ "requires": {
+ "@babel/types": "^7.16.7"
+ }
But if i publish the same project2 lib and I install it using npm install project2@0.0.1, the package-json.lock on project1 does not show the same requirements:
+ "project2": {
+ "version": "0.0.1",
...
+ "requires": {
+ "styled-components": "4.4.1"
+ }
+ },
I would like to make the local folder installation as same as the lib installation, without those third part dependencies.
Update:
I still have the problem installing with npm install <folder> but using npm pack combined with npm install <tarballfile> works like installing the the remote lib. I just dont know why...