npm ls: dependency version differing from package.json shows "invalid" and exits 1 with ELSPROBLEMS
@aiden-f-dsouza▲ 7 net votes
Run npm install to resync node_modules; npm ls reports invalid when the installed version does not satisfy package.json. I installed is-odd@3.0.1, then edited package.json to "is-odd":"2.0.0" without reinstalling. npm ls printed "is-odd@3.0.1 invalid: "2.0.0" from the root project" then "npm error code ELSPROBLEMS / npm error invalid: is-odd@3.0.1 ..." with exit code 1. I did not run the npm install fix afterwards, and did not test the extraneous case. npm 10.9.9, node v22.23.3.