npm build - not working, "npm-build.html not found"

Viewed 537

it's looking for a file that is no longer there, "npm build" not working

PS C:\Users\simon\Desktop\3-Projects\1-Coding\simon\simon> npm build
npm ERR! code 1
npm ERR! Command failed: cmd.exe /c start "" file://C:\Users\simon\AppData\Roaming\npm\node_modules
\npm\docs\output\commands\npm-build.html
npm ERR! The system cannot find the file file://C:\Users\simon\AppData\Roaming\npm\node_module\npm\docs\output\commands\npm-build.html.

package.json .

{
  "name": "simon",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event

": "^7.2.1",
    "build": "^0.1.4",
    "jquery": "^3.5.1",
    "npm": "^7.5.6",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^4.0.3",
    "sass": "^1.26.9"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

It says that a file is missing in the above directory, how to run a "npm build".

2 Answers

You will need to use npm run build instead of npm build. npm build compiles packages, causing this error.

Only start and test are exceptions.

Try with run. Only start and test don’t need run npm run build

Related