我需要一些帮助来运行我的第一个开源项目

时间:2021-01-26 20:36:10

标签: node.js reactjs npm

我需要一些帮助才能让我的第一个开源项目在我的机器上运行。我有一台运行 Big Sur 11.1 (20C69) 的 2018 款 15 英寸 MacBook Pro。我使用 VS Code 作为我的 IDE。我已经为我的项目分叉并克隆了存储库。

我已按照有关如何让应用在此处运行的说明进行操作:

https://github.com/bancodobrasil/stop-analyzing-embed

以下是有关如何贡献的说明:

https://github.com/bancodobrasil/stop-analyzing-embed/blob/master/CONTRIBUTING.md

这是我被分配的问题,我将继续努力:

https://github.com/bancodobrasil/stop-analyzing-embed/issues/72

我先运行“npm install”,然后运行“npm run dev”。

这是我在终端中遇到的错误:

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
ShoaibKhansMBP:stop-analyzing-embed shoaibkhan$ cd app
ShoaibKhansMBP:app shoaibkhan$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: stop-analyzing-embed@0.2.0
npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR! react@"^16.13.1" from the root project
npm ERR! peer react@">=16.9.0" from @testing-library/react-hooks@3.3.0
npm ERR! node_modules/@testing-library/react-hooks
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.1" from react-test-renderer@17.0.1
npm ERR! node_modules/react-test-renderer
npm ERR! peer react-test-renderer@">=16.9.0" from @testing-library/react-hooks@3.3.0
npm ERR! node_modules/@testing-library/react-hooks
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/shoaibkhan/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/shoaibkhan/.npm/_logs/2021-01-26T14_56_13_324Z-debug.log
ShoaibKhansMBP:app shoaibkhan$ npm run dev

stop-analyzing-embed@0.2.0 dev
REACT_APP_BACKEND_URL=http://localhost:8008 yarn start
sh: yarn: command not found
npm ERR! code 127
npm ERR! path /Users/shoaibkhan/Documents/Treehouse/Open Source Projects/stop-analyzing-embed/app
npm ERR! command failed
npm ERR! command sh -c REACT_APP_BACKEND_URL=http://localhost:8008 yarn start

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/shoaibkhan/.npm/_logs/2021-01-26T14_56_33_589Z-debug.log
ShoaibKhansMBP:app shoaibkhan$

有人可以帮我让它运行吗。

谢谢,

绍伊卜·卡迈勒·汗

1 个答案:

答案 0 :(得分:0)

错误消息告诉我们未安装 yarn。查看 dev 中的 package.json 脚本,我们可以看到实际运行的命令:

"dev": "REACT_APP_BACKEND_URL=http://localhost:8008 yarn start",

问题是它没有在 package.json 中列为 (dev-) 依赖项(您可能想为此创建一个 PR),因此您在执行 {{1} 时没有安装它} .

要解决此问题并安装纱线,您应该运行以下命令: npm i 或使用 npm i -D yarn 全局安装。

相关问题