如何编译和 运行 附加的 React Web 应用程序?

How can I compile and run the attached react web application?

我是节点和 npm 的新手。我一直在尝试编译我在 GitHub (https://github.com/marshallmurphy/Web-Apps/tree/master/Medication%20Reminder%20React%20App) 上找到的这个药物提醒应用程序,但 npm 不断产生错误。我试过 "npm start" 和 运行ning "webpack" 但没有成功。我如何在终端中编译和 运行 这个文件?

当我 运行 npm start 时出现以下错误:

Dantes-MBP:Medication Reminder React App dantegreyson$ npm start

> medication-reminder-app@1.0.0 start /Users/dantegreyson/Desktop/Medication Reminder React App
> webpack-dev-server

sh: webpack-dev-server: command not found

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! medication-reminder-app@1.0.0 start: `webpack-dev-server`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the medication-reminder-app@1.0.0 start script 'webpack-dev-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the medication-reminder-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs medication-reminder-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls medication-reminder-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dantegreyson/Desktop/Medication Reminder React App/npm-debug.log

我尝试按照建议全局安装 webpack,但现在出现以下错误:

Dantes-MBP:Medication Reminder React App dantegreyson$ npm start

> medication-reminder-app@1.0.0 start /Users/dantegreyson/Desktop/Medication Reminder React App
> webpack-dev-server

module.js:471
    throw err;
    ^

Error: Cannot find module 'html-webpack-plugin'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/dantegreyson/Desktop/Medication Reminder React App/webpack.config.js:1:87)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! medication-reminder-app@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the medication-reminder-app@1.0.0 start script 'webpack-dev-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the medication-reminder-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs medication-reminder-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls medication-reminder-app
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dantegreyson/Desktop/Medication Reminder React App/npm-debug.log

如果您查看脚本部分中的 package.json,您将看到它试图 运行 "start": "webpack-dev-server"。所以你应该全局安装 webpack-dev-server sudo npm install webpack-dev-server -g 应该为你施展所有魔法。

更新

确保您 运行 npm install 命令