简体   繁体   English

当我尝试运行 React 样板 localhost 时出现错误

[英]When I try to run React boilerplate localhost I getting the error

Reference: https://github.com/react-boilerplate/react-boilerplate参考: https://github.com/react-boilerplate/react-boilerplate

I have tried to run the project in localhost as per instructions, but the getting the below code any one could help me please我已尝试按照说明在 localhost 中运行该项目,但是获取以下代码任何人都可以帮助我

npm ERR: code 1 npm ERR! npm 错误:代码 1 npm 错误! path C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\pngquant-bin路径 C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\pngquant-bin
npm ERR: command failed npm ERR. npm ERR:命令失败 npm ERR。 command C.\WINDOWS\system32\cmd:exe /d /s /c node lib/install:js npm ERR.命令 C.\WINDOWS\system32\cmd:exe /d /s /c node lib/install:js npm ERR。 ‼ Command failed: C,\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\pngquant-bin\vendor\pngquant:exe --version npm ERR. ‼ 命令失败:C,\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\pngquant-bin\vendor\pngquant:exe --version npm ERR。 npm ERR: npm ERR: ‼ pngquant pre-build test failed npm ERR: i compiling from source npm ERR: × Error: pngquant failed to build. npm ERR: npm ERR: ‼ pngquant pre-build test failed npm ERR: i compiling from source npm ERR: × Error: pngquant failed to build. make sure that libpng-dev is installed npm ERR!确保安装了 libpng-dev npm ERR! at C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\execa\index.js:231:11 npm ERR!在 C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\node_modules\execa\index.js:231:11 npm 错误! at processTicksAndRejections (node:internal/process/task_queues:96:5) npm ERR!在 processTicksAndRejections (node:internal/process/task_queues:96:5) npm 错误! at async Promise.all (index 0)在异步 Promise.all(索引 0)

npm ERR: A complete log of this run can be found in: npm ERR. npm ERR:此运行的完整日志可在以下位置找到:npm ERR。 C:\Users\ksche\AppData\Local\npm-cache_logs\2022-08-15T14_41_21_036Z-debug-0.log PS C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project> npm start C:\Users\ksche\AppData\Local\npm-cache_logs\2022-08-15T14_41_21_036Z-debug-0.log PS C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project>46DC812E862461B

react-boilerplate@4.0.0 start cross-env NODE_ENV=development node server react-boilerplate@4.0.0 启动跨环境 NODE_ENV=开发节点服务器

node:internal/modules/cjs/loader:936 throw err; node:internal/modules/cjs/loader:936 抛出错误; ^ ^

Error: Cannot find module 'express' Require stack:错误:找不到模块“express”需要堆栈:

  • C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load ( node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18)在 Object。 (C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js:3:17) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js' ] } (C:\Users\ksche\Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js:3:17) 在 Module._compile (node:internal/modules/cjs/loader:1103:14) 在 Object。 Module._extensions..js (node:internal/modules/cjs/loader:1155:10) 在 Module.load (node:internal/modules/cjs/loader:981:32) 在 Function.Module._load (node:internal /modules/cjs/loader:822:12) 在 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\ksche\ Documents\Projects\React_BoilerPlate\into\new_Project\server\index.js' ] }

It's likely express wasn't installed correctly.可能 express 安装不正确。 try running npm install express in the terminal(you should be in the root folder of your project).尝试在终端中运行npm install express (您应该在项目的根文件夹中)。

If you now run express -v , the version of express you have should be returned to you.如果您现在运行express -v ,您拥有的 express 版本应该返回给您。

If not, verify you are in the correct directory for your project when entering the above commands, and try again.如果没有,请在输入上述命令时验证您是否位于项目的正确目录中,然后重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试在 android 上运行 React Native 应用程序时出错 - getting error when i try to run react native app on android 当我第一次尝试在我的 Windows 10 机器上运行 react 时,我在 localhost:3000 的浏览器中收到此错误 - When I try to run react for first time on my Windows 10 machine, I get this error in the browser at localhost:3000 当我尝试开始响应时,为什么会出现此错误? - Why am I getting this error when I try to start react? 当我尝试使用npm start命令运行React App时出错 - Error when I try run a React App with npm start command 尝试在AWS上运行React Web时出现网络错误 - Network Error when I try to run React web on AWS 如何减少react-redux样板-我尝试创建ComponentFactory,但出现React-redux错误 - How to reduce react-redux boilerplate - I try creating a ComponentFactory but I'm getting react-redux errors 尝试运行android react-native项目时出错 - Getting error when try to run android react-native project React App:为什么当我尝试运行 npm start 脚本时出现错误? - React App: Why I get an error when I try to run npm start script? 当我尝试运行 react-native expo cli 时遇到此错误 - I faced this error when I try to run react-native expo cli 当我尝试在webpack中使用react-router时为什么出现jsx-loader错误 - Why am I getting a jsx-loader error when I try to use react-router with webpack>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM