Recently, I made updates to my project that involved Vue.js and Typescript. After updating webpack and webpack-dev-server, I encountered a problem where certain modules were missing when attempting to run the project in development mode.
Here is some additional information:
Here are the versions of the packages I am using:
"npm": "6.0.0",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3",
"webpack-dev-server": "^1.16.5"
The command I use to run the app in development mode from my package.json
file is:
cross-env NODE_ENV=development webpack-dev-server --open --inline --hot --display-error-details
Upon running this command, I encounter the following error:
module.js:545
throw err;
^
Error: Cannot find module 'webpack/bin/config-optimist'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/project_folder/node_modules/webpack-dev-server/bin/webpack-dev-server.js:64:1)
I have already attempted the following troubleshooting steps:
- Reinstalling webpack;
- Removing node_modules and running
npm install
again; - Manually adding the code from the file 'config-optimist.js' by downloading it from (found here) but this resulted in another missing module issue.
If anyone has any suggestions or ideas on how to resolve this issue, please share them. Thank you!