Tag Archives: webpack

[Solved] Postcss Error: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

This error occurs when packaging with postcss:   Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.

I’ve been searching for information for a long time because the versions are incompatible,

Solution: create a new postcss.config.js file under the root directory

The file configuration is as follows

module.exports={
    plugins:[
        require("postcss-preset-env")
    ]
}

Then delete the options in webpack.config.js and package again.

type of the byte recordError: webpackMerge is not a function

Error message:

WebpackMerge is not a function

 

It is found that webpack merge cannot be used directly according to the error report

After viewing the document

Change it to webpackmerge. Merge and there will be no error

Webpack step on the road to record   If you want to see the actual combat article of webpack, please click

[Solved] Error: Cannot find module ‘webpack-cli/package.json‘

Solution:npm install webpack-cli -g

Error: Cannot find module 'webpack-cli/package.json'
Require stack:
- C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)
    at runCli (C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:65:26)
    at C:\Users\12987\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:154:5
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\12987\\AppData\\Roaming\\npm\\node_modules\\webpack\\bin\\webpack.js'
  ]
}

Module not found: Error: Can‘t resolve ‘core-js/modules/es.promise.js‘ in

Core-js is not installed
In the directory where package.json is located: npm i core-js -D

ERROR in . /src/js/index.js 1:0-48
Production environment configuration \15js compatibility handling\src\js'

ERROR in ./src/js/index.js 2:0-39
Module not found: Error: Can't resolve 'core-js/modules/es.promise.js' in 'D:\Desktop\My Files\RecentlyStudy\WebPack\demo\3.webpack production environment configuration 
webpack production environment configuration \15js compatibility handling\src\js'

ERROR in ./src/js/index.js 3:0-39
Module not found: Error: Can't resolve 'core-js/modules/web.timers.js' in 'D:\Desktop\My Files\RecentlyStudy\WebPack\demo\3.webpack

3 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

NPM start project error: cannot find module ‘webpack’ problem solution

First install cnpm and then use cnpm i to install the package when stuck and then force to end the download and then install node_modules again after the error error, start the project when npm run serve reported the following error.
The correct approach: If you force to interrupt the download, you should remove the node_modules and reinstall them, no error after the end of the installation means success
PS D:\code\DA_svn\pages\index> npm run serve
> [email protected] serve D:\code\DA_svn\pages\index
vue-cli-service serve
INFO  Starting development server…
ERROR  Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module ‘webpack’
Require stack:
– D:\code\DA_svn\pages\index\node_modules\[email protected]@webpack-dev-server\lib\Server.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\commands\serve.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\lib\Service.js
– D:\code\DA_svn\pages\index\node_modules\_@[email protected]@@vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pactera\AppData\Roaming\npm-cache\_logs\2021-03-09T00_59_46_004Z-debug.log

Using webpack to report typeerror: this.getresolve is not a function

##Using webpack to report typeerror: this.getresolve is not a function

###Error reason: the webpack version is too low or the loader version is too high

this is the original configuration version

##Solutions:
1. Upgrade the version of webpack to the highest version (there are many changes in the version of webpack, so I’m afraid it won’t catch up with others, So you can choose not to change the webpack version)
2. Reduce the version of the loader
(1) manually reduce the downloaded version of the loader in package.json

(2) download the loader you just used again

and then run it again

Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’

Before, the project directory was:

it ran successfully. Later, a new build file directory was created and the webpack.config.js It is moved to the build file,

package.json Script in

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node ./src/koa.js",
    "build": "webpack --config ./build/webpack.config.js"
  },

After configuration, run the

$ npm run build

Results error prompt:

Unable to resolve dependency tree

When installing webpack dev server on the command line, errors are reported all the time, and it is OK to check many places, including the error information on the terminal,

(this is not my error message, I forgot the screenshot, this is in the

https://stackoverflow.com/questions/64874754/unable-to-resolve-dependency-tree-with-esling-config-airbnb

(seen on the Internet)

I didn’t see anything,

Finally, I will save my folder except node_ All files except modules are sent to the person who successfully installed them, and they are asked to try whether they can be successfully installed on his computer. As a result, they can be installed

Therefore, it is considered that the plug-in incompatibility is caused by the high version of node

1. Use node – V to view the node version number

2. I installed 15.3.0 node.js Go to the latest version of the official website node.js There is a stable version of 14.15.1 on the Chinese website

3. In the control panel node.js After uninstalling, install with the lower version of the installation package (do not uninstall the higher version of the installation package) node.js Cannot install lower version)

4. Download the plug-in successfully….

Error: Cannot find module ‘process-nextick-args’

1. Error description

C:\Users\Administrator>cd cma

C:\Users\Administrator\cma>webpack you.js today.js
C:\Users\Administrator\node_modules\webpack-cli\bin\webpack.js:449
                                throw err;
                                ^

Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
    at Function.Module._load (internal/modules/cjs/loader.js:497:25)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile-
cache.js:159:20)
    at Object.<anonymous> (C:\Users\Administrator\node_modules\_readable-stream@
2.3.6@readable-stream\lib\_stream_readable.js:26:11)
    at Module._compile (C:\Users\Administrator\node_modules\v8-compile-cache\v8-
compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile-
cache.js:159:20)
    at Object.<anonymous> (C:\Users\Administrator\node_modules\_readable-stream@
2.3.6@readable-stream\readable.js:12:30)
    at Module._compile (C:\Users\Administrator\node_modules\v8-compile-cache\v8-
compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile-
cache.js:159:20)
    at Object.<anonymous> (C:\Users\Administrator\node_modules\[email protected]@
duplexify\index.js:1:76)
    at Module._compile (C:\Users\Administrator\node_modules\v8-compile-cache\v8-
compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile-
cache.js:159:20)
    at Object.<anonymous> (C:\Users\Administrator\node_modules\[email protected]@pu
mpify\index.js:3:17)
    at Module._compile (C:\Users\Administrator\node_modules\v8-compile-cache\v8-
compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile-
cache.js:159:20)
    at Object.<anonymous> (C:\Users\Administrator\node_modules\[email protected].
0@mississippi\index.js:3:27)
    at Module._compile (C:\Users\Administrator\node_modules\v8-compile-cache\v8-
compile-cache.js:178:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)

C:\Users\Administrator\cma>

2. Cause of error

When prompted that the relevant JSON file is missing, execute the cnpm install — save dev webpack installation command, and then switch to the specified folder again to you.js The above error occurred when packaging.

3. Solutions

Run “cnpm install — save process next args”

C:\Users\Administrator>cnpm install --save process-nextick-args
√ Installed 1 packages
√ Linked 0 latest versions
√ Run 0 scripts
√ All packages installed (1 packages installed from npm registry, used 236ms, s
peed 13.95kB/s, json 1(3.29kB), tarball 0B)