Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code in node_modules is not reflected in browser

I have forked the vuejs-datepicker project on Github (because of a bug in the project, but that is irrelevant in this matter). The changes I make to this forked project does not reflect in the end result in the browser, in my project that are using this dependency.

Here´s what I do:

  1. Add console.log´s, alerts and even remove som key functionality from the source code to make sure that the changes are easy to detect
  2. Commit and push the changes to the forked project
  3. In my main project I now run npm update, and afterwards I verify that the changes can be seen in the relevant file/files in the node_modules\vuejs-datepicker folder
  4. I run npm run serve and my main project loads. The changes I´ve made is not reflecting in the browser

File in node_modules folder: File content in node_modules

The compiled file in Chrome (I can verify that this is the running code with a breakpoint): compiled file in chrome

Package.json: package.json

I´ve tried clearing the npm cache with npm cache clean, removing the project reference from package.json and reference it again, bumping the version, but it seems like it is using some cache from the first time I used this forked project which I can´t seem to locate. I´ve also tried clearing the dist folder and my browser´s cache which had no effect, but I guess webpack is making sure this is not an issue.

Am I missing anything here?

like image 321
Farsen Avatar asked Aug 08 '26 13:08

Farsen


1 Answers

Try the following commands to reset node_modules

rm -rf node_modules package-lock.json
npm install
like image 71
David Bradshaw Avatar answered Aug 10 '26 02:08

David Bradshaw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!