我怎样才能编译和运行附加的反应Web应用程序?

我是新的节点和NPM。 我一直在试图编译这个药物提醒应用程序,我发现GitHub( https://github.com/marshallmurphy/Web-Apps/tree/master/Medication%20Reminder%20React%20App ),但npm不断产生错误。 我试过“npm start”并运行“webpack”,但没有运气。 我怎样才能在terminal上编译和运行这个文件?

运行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 

我试图按照build议全球安装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命令