LearnWebCode / react-course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request for help on the problem below. Thank you.

ngylong opened this issue · comments

Hi, I can't get npm run dev to work. Please assist.

Thank you very much.
Yong.

PS C:\zEdu2\complex-react-app> npm run dev

complex-react-app@1.0.0 dev C:\zEdu2\complex-react-app
webpack-dev-server

'webpack-dev-server' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! complex-react-app@1.0.0 dev: webpack-dev-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the complex-react-app@1.0.0 dev 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\YongLong\AppData\Roaming\npm-cache_logs\2021-01-08T03_58_06_457Z-debug.log
PS C:\zEdu2\complex-react-app>


-- package.json--
{
"name": "complex-react-app",
"version": "1.0.0",
"description": "",
"main": "test.js",
"scripts": {
"dev": "webpack-dev-server",
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"babel-loader": "^8.2.2",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
}

Replace this "dev": "webpack serve" instead of "dev": "webpack-dev-server" because the command webpack-dev-server is no longer available.now run it with command npm run dev then it works.