A React build warning that is obscure and troublesome.


(Bruce Martin) #1

I just started to get this warning when I do a yarn build:

warning …\package.json: “dependencies” has dependency “react” with range “^15.2.1” that collides with a dependency in “devDependencies” of the same name with version “^0.13.1”

How do I handle fixing this? There is no dependency in “devDependencies” in my package.json named “react”. Here is the list:

“devDependencies”: {
“enzyme”: “^2.9.1”,
“faker”: “^4.1.0”,
“react-addons-test-utils”: “^15.6.0”,
“react-scripts”: “^1.0.10”,
“react-test-renderer”: “^15.6.1”
},

This warning does not seem to have any effect on my build since I deploy it to Azure and it runs correctly (as far as I can see) on my devices.


(Bruce Martin) #2

I have determined that this warning only happens when my project is running in a folder under my DropBox account. And also I determined that the waning happens with any new, unchanged app if created under a DropBox folder. When a new app is created outside of DropBox, there is no warning. Why does this happen. I have been creating tens of experimental apps over the past few months, all under my DropBox folder and have not had this problem before now.


(Sophie Alpert) #3

Maybe you have an extra node_modules folder in Dropbox that is causing problems?


(Bruce Martin) #4

Aren’t node_module folders only accessed in the scope of their project folder? I can not find any node_module folders outside of their project folders. There are hundreds of them. (All within my DropBox folder). The plain vanilla Create-React-App project has 154 of them. Thanks for the idea though.

I’ve been working for a year on learning React for a personal project, all the time coding within my DropBox folder, and never had a problem until this came up a few weeks ago.


(Sophie Alpert) #5

I was thinking something like ~/Dropbox/node_modules in particular. I’m not sure why else that folder would be different from any other.


(Bruce Martin) #6

I don’t have a ~/Dropbox/node_module. This issue does not seem to have any effect on running yarn start for development, or on yarn build for deployment to Azure. When I’m ready to build for distribution, I’ll move my project folder out of Dropbox. In the meantime I’ll leave it there for the extra backup. Thanks.


(Bruce Martin) #7

I moved all my React project folders out from under DropBox and the warning went away. I moved the one current React project folder back to the DropBox folder and the warning has stayed away. So some combination of my tutorials and experiments in the other folders seems to be the cause. I’ll just move the others back one by one as I have a need to use them again and see what happens.