Im trying to create my built folder for a react project, but I get this error when I run the command 'npm run build'
(base) tazar@Tazs-Air nft-minter-tutorial-main % npm run build
npm ERR! Missing script: "build"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tazar/.npm/_logs/2022-02-25T01_15_14_544Z-debug.log
CodePudding user response:
You can check standard react package.json(which is located in root folder of your project) file:
{
"name": "print",
"version": "0.1.0",
"private": true,
"dependencies": {
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
CodePudding user response:
in your package.json file add build script, for example:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},