Whenever I execute npm install
or npm ci
, it triggers a webpack build that generates a plethora of incorrect errors. These errors allude to missing dependencies that are actually present. Interestingly, running npm ci
seems to produce more errors than npm install
.
However, executing the webpack build itself works flawlessly.
I am puzzled by this behavior as there doesn't seem to be any documentation on what exactly initiates this webpack build.
I would like to understand the following:
- What prompts webpack during
npm install
? (I simply want it to install dependencies) - Why do these strange error messages appear?
My setup includes:
- WSL 2 (Ubuntu 21.04) on Windows 11
- NPM 7.5.2
- Webpack ^5.65.0
An example of the error output is as follows:
matthias@daiquiri:~/dev/hamster-books$ npm ci
asset main.js 42.9 KiB [emitted] (name: main)
...
ERROR in ./app/js/dispatcher.js ...
Module not found: Error: Can't resolve 'ts-loader' in '/home/matthias/dev/hamster-books'
@ ./app/js/hamstersBooks.js ...
The output goes on for some time, with repeated attempts at running webpack. Upon inspection, all the referenced directories and files exist. Some originate from the <code>node_modules
while others are standard project references.