I recently updated Nodejs to 8.11.3 from either 8.11.2 or 8.11.1, and when I ran NPM install on my project, it updated the modules and for some of the modules that I am using in my project ( most are dependencies ), for example, ip, bignumber.js, inflection, to name some specifics, npm removed the "main": attribute from the package.json file. I have the same dependencies I've always had, and never had this issue before. So when I went to run my project I got the error message:
"Cannot find module 'ip'"
for example. When I went to the git page for the module and copied the "main": attribute from the package.json on the project page, it solved the problem.
"main": "lib/ip",
What I want to know is how to get NPM from removing the "main": attribute. I need NPM to install the modules intact... I can't be making modifications to the modules to get it to work, my development machine is using Windows 10. I usually commit the project to the git on the server after I have tested it locally to know everything is working. I don't upload the modules, the server pulls the dependency modules from the repositories when I do a commit. The server uses NPM and it would not be easy to change to something else because I don't control that aspect of the server.
I don't want to worry about the same thing happening on the server...