Killed my app dev environment with a simple npm command, help needed

I was setting out to work with Vue Routes and started with

npm install vue-router@4

which resulted in an error message about unsatisfied dependencies. I tried to resolve that by updating other modules, then updating all modules (npm update -g) which made everything worse. Eventually I decided to start over with

gmake clean-dev

which removed my node_modules directory.

I was under the impression that when building and packing my app (gmake build-js) all dependencies are resolved and modules are created or updated in the local node_modules directory.

I noticed that building my app still seemed to work at this point, even though the directory was gone. I searched and found plenty of npm modules one level up in apps/node_modules. Using those would sure make less problems with dependencies.

By trying to make things right I made everything worse up to the point where not even webpack can be found for building my app:

gmake build-js
npm run dev

> abakus@0.1 dev
> webpack --node-env development --progress

/tmp/dev-7582b89b.sh: webpack: not found
gmake: *** [Makefile:36: build-js] Error 127

I recalled that for setting up the webpack-compiler-dependecy-complex for a fresh project one has to init the environment. Only this fails now, too:

gmake npm-init
npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @nextcloud/eslint-config@7.0.2
npm ERR! Found: eslint@7.32.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^7.5.0 || ^8.0.0" from @babel/eslint-parser@7.16.5
npm ERR!   node_modules/@babel/eslint-parser
npm ERR!     peer @babel/eslint-parser@"^7.16.5" from @nextcloud/eslint-config@7.0.2
npm ERR!     node_modules/@nextcloud/eslint-config
npm ERR!       dev @nextcloud/eslint-config@"^7.0.2" from the root project
npm ERR!   peer eslint@">=6.0.0" from @nextcloud/eslint-plugin@2.0.0
npm ERR!   node_modules/@nextcloud/eslint-plugin
npm ERR!     peer @nextcloud/eslint-plugin@"^2.0.0" from @nextcloud/eslint-config@7.0.2
npm ERR!     node_modules/@nextcloud/eslint-config
npm ERR!       dev @nextcloud/eslint-config@"^7.0.2" from the root project
npm ERR!   13 more (@nextcloud/webpack-vue-config, eslint-plugin-es, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^8.6.0" from @nextcloud/eslint-config@7.0.2
npm ERR! node_modules/@nextcloud/eslint-config
npm ERR!   dev @nextcloud/eslint-config@"^7.0.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: eslint@8.21.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^8.6.0" from @nextcloud/eslint-config@7.0.2
npm ERR!   node_modules/@nextcloud/eslint-config
npm ERR!     dev @nextcloud/eslint-config@"^7.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-06T08_01_10_767Z-debug-0.log
gmake: *** [Makefile:29: npm-init] Error 1

Before I kill everything and start over with a fresh instance of NC I am trying hard to understand

  • where npm modules get pulled from (locally or from the apps directory)
  • where npm modules get installed when I use the plain npm install command
  • how to fix or rest my setup so that any work with compiling, packing or installing is possible again

Bonus question: is there a way to not update all the existing npm modules upon each build? Development is real slow when you have gmake times between 12 and 30 seconds.

Any help is much appreciated!