NPM run build error solution

An error is as follows

checked online related:
because package json file does not have to configure the build script, so the above error!
1. Add build script to scripts in package.json:

  "scripts": {
    "build": "cross-env NODE_ENV=production webpack --config webpack.config.js"

“NODE_ENV” : user-defined environment variable
webpack “: integrated packaging command
“>config” : config file
“webpa>onfig.js” : config file, which is a Node. js module that returns a JSIN-formatted configuration information object, or the –config option to specify the configuration file

It is possible that ‘cross-env’ is not an internal or external command and is not a executable program
can be resolved by NPM I –save-dev cross-env.
The results of
Execute NPM run build, and the results will appear in the dist folder. Successful packaging!


Read More: