NPM run build package error reporting
Problem description
1. Because I recently updated my global webpack version, some old projects report errors in install;
2. For an old project, the webpack version is not specified in devdependences in package.json, which causes the project to fail during NPM install. Solve the problem by specifying the webpack version as ^ 4.0.0;
3. Later, when the project was modified and packaged, an error was reported:
Building for production… Error typeerror: cannot read property ‘createhash’ of undefined
final solution
NPM install webpack @ ^ 4.5.0 – d
or
yarn add webpack@^4.5.0 -D
The problem can be solved by updating the version of webpack to version 4.5.0. I tried it again and again from @ ^ 4.0.0, @ ^ 4.1.0, @ ^ 4.2.0 and @ ^ 4.5.0. Really
Summarize the lessons of
blood and tears. Although I didn’t start this project, I tasted its pit, so remember to add the local webpack version number to package.json when starting a project in the future. Remember ~ ~ ~
Similar Posts:
- Vue Project: npm run dev :missing script:dev [How to Solve]
- npm ERR! missing script: dev [How to Solve]
- npm ERR! missing script: dev [How to Solve]
- Webpack packaging error: cannot find module ‘webpack / bin / config yargs’ error reason, [email protected] Step on the pit~
- Webpack introduces HTML webpack plugin and reports an error
- npm WARN saveError ENOENT: no such file or directory, open ‘C:\Users\James\package.json’
- How to Use Yarn instead of NPM
- npm ERR! missing script: build [How to Solve]
- Error:Rule can only have one resource source [How to Solve]
- [Solved] [email protected] Error: Cannot find module ‘webpack/bin/config-yargs‘