首页 > 解决方案 > 在来自 github 的 react 项目上运行 npm install 时出现 npm err code 1

问题描述

我现在正在学习网络开发一段时间。我正在使用 React.js 库。每当我尝试从 Github 克隆一个 react 项目并运行 npm install 时,我都会收到以下错误:你能帮我解决这个问题吗?

npm ERR! code 1
npm ERR! path C:\Users\user\OneDrive\old Desktop\web developer\developer-portfolio\node_modules\node-sass     
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\user\OneDrive\old Desktop\web developer\developer-portfolio\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp ERR! node -v v14.16.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2021-06-22T14_17_09_580Z-debug.log

标签: reactjsnpm

解决方案


推荐阅读