An error is as follows
checked online related:
.
because package json file does not have to configure the build script, so the above error!
Solutions:
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!
Reference: https://www.cnblogs.com/tugenhua0707/p/9780621.html
https://www.cnblogs.com/eyunhua/p/6507100.html
Read More:
- Vue3 uses webpack bundle analyzer to analyze package files
- Invalid host header error in Vue using peanut shell agent
- NPM run build failed to package err! Missing script: build
- NPX webpack cannot find module’html webpack plugin’a bug causes headache
- Gulp failed to run
- Cannot find module ‘webpack cli / bin / config yargs‘
- Package python3.1 + PyQt4 into exe
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Node configuration environment variable and global installation of webapck
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Quickly create a local typescript running environment.
- Module parse failed:Unexpectedtoken (1:0)You may need an appropriate loader to handle this file type
- NPM err! Code enotfound (2020-07-03)
- NPM run dev error: cannot find module ‘webpack cli / bin / config yargs‘
- Error failed to build IOS project. We ran “xcodebuild” command but it exited wit
- Vue — run ‘NPM audit fix’ to fix them, or ‘NPM audit’ for details appears when initializing the installation
- “%Error opening tftp://255.255.255.255/network config”
- Simple solution for node sass installation failure
- ERROR in Entry module not found Error Can t resolve
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)