Fork pancakeswap frontend - cryptocurrency

Trying to fork pancakeswap from https://github.com/pancakeswap/pancake-frontend.
Steps what I did,
Clone Repo
Run npm install command
Run npm start command
Solve some no-used props error by commenting that props. After that also 2 errors are still in application.
Error1: JSX props should not use functions react/jsx-no-bind
Error2: defaultProp "expanded" has no corresponding propTypes declaration react/default-props-match-prop-types
Help me to solve this. Stuck more than 5 days. Searched many pages but no use. Most of them are suggested to change jsx functions. Is there is any simple way to solve these errors?

I did the same yesterday and it worked. There are still some elements that I need to figure out, but to make it running on localhost wasn't hard.
Before running pancakeswap frontend we need to have nodejs installed. Should work with any version 16, my was v16.14.0. Second is to have installed yarn as they don't use npm. This we know because the project has yarn.lock file. Third is have nextjs installed globally like yarn. With this we should be able to install and run the app.
Next steps would be:
Clone repo or just download it, will work as well
Run yarn install command (or just yarn - works the same)
Run yarn build (this will call next build)
Run yarn start (this will call next start)
After last step the app should start on localhost:3000
This is what I did and it worked. Keep in mind that this is valid for the current version and could change in future.

Related

Why is the create-react-app command not working?

Wanted to create a new react app, and ran both npx create-react-app and init react-app command in my Mac terminal but it's not working.
Tried a couple of times, but sometimes the folder is created with a package.json file only. Then everything stopped downloading. What could be the issue?
Screenshot of the output in the terminal:
According to your screenshot, there is no problem when you initialize your react project.
I think your local network may not be good enough. To create a react app, you need to install many third-party nodes_modules then cause mistakes.
Therefore, you can try to change the npm source, such as taobao( https://registry.npm.taobao.org )
npm config set registry xxx
And then use the craete-react-app to initialize the app.

Simple NPM Question Re-updating local react project after other dev added new package

I just started working with vscode and npm/git. Someone on my team added a package and I did a pull to get his latest changes which put that package in my package.json file. When I ran the project I got errors for a module not being found. Obviously I need to install that package locally. Do I simply use npm install w/no arguments to get it? Or do I install it manually myself with npm install and version info? I ask because I don't know if npm install w/no args will create a new package.json or cause any issues.
What is the correct way to get a new package installed that someone added in the repo?
npm install can be run as many times as you like, and is what you should be doing here :)
npm install's purpose is to get your node_modules folder up-to-date with whatever is written in package.json
So, if your colleague has changed package.json (by installing something new and pushing the change to git), you can just run the command again to get up-to-date.
Provided you haven't directly fiddled with any files in node_modules (this folder should be left alone), it is always safe to run npm install as many times as you like, even if nothing has changed.

hardhat, truffle, brownie, react stopped working?!? error Command failed with exit code 1

I was working with brownie and everything was working smoothly, launched my first useDapp app and it was a lot of fun. I wanted to see what truffle was about and installed it via npm and there were a bunch of warnings and it didn't seem smooth when it came to functionality so I might have installed it via yarn, expecting the package installer to fix things. It worked for a while then it started to timeout upon migration with tested code that used to launch perfectly fine? I thought it might of been a bug or some form of overlapping installation. I moved on to hardhat and installed it via NPM and it wouldn't compile, so I installed it via Yarn and it compiled fine. I went on to creating a new file and accidentally hit Esc when it was initializing a new file and setting the root. Somewhere in between there I tried to install the shorthand and it didn't work. It only opened a Windows help window instead of call hardhat when I typed hh --help. After that I couldn't call hardhat via yarn hardhat nor npx hardhat outside of the file....the file that previously wouldn't compile was still able to compile via npx hardhat compile?
It sometimes says "module not found", other times it says something about local installation.
I kind of got frustrated and wanted to play with react a little more and when I went to start yarn I got an error message. I followed the prompt and it didn't work, I googled it and had no luck with their common resolutions. I tried to upgrade eslint and even install 7.11.0 and it keeps saying I have version 5.16.0?.
EDIT: not sure if it is relevant, I tried to update my yarn to 1.22.17 and it said it did, although it says im running 1.22.15.
windows 7
node = v12.13.0
npm =6.12.0
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^7.11.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
C:\Users\Nancy\node_modules\eslint (version: 5.16.0)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if C:\Users\Nancy\node_modules\eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls eslint in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed eslint.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
error Command failed with exit code 1.
Kind of embarrassing, the answer was in the error message.
6. Check if C:\Users\Nancy\node_modules\eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Hardhat set root in the wrong directory and I ended up with a node_module folder in a parent directory that was messing things up
Reinstalled truffle globally via yarn add global truffle and it ran smoothly. Evidently, truffle acts up with certain NPM versions.
Hardhat doesn't seem to support global installations yet. Its been working fine being locally installed into each separate hardhat project via yarn add -D hardhat
I haven't been able to get the shorthand to work without invoking yarn first, such as yarn hh <command>

How to Yarn add a specific branch/workspace

I forked react-select to add a couple of features that the current react-select doesn't have. I created a branch and committed it to my forked project. Now, i want to use the forked project.
Ive tried installing the forked react-select repo the following ways with out success.
yarn add #react-select/monorepo#<GithubUsername>/react-select#head=<Name of branch>&workspace=react-select
yarn add #react-select/monorepo#<GithubUsername>/react-select#commit=<commit#>&workspace=react-select
yarn add #react-select/<github url>#head=<Name of branch>&workspace=react-select
I've tried it with ssh, with git+. with everything that the yarn website says and all i get is react-select installed but i don't see the code changes thats in my branch.
I've also tried to install the react-select package that the monorepo uses, but i get the following error
yarn add react-select#https://github.com/<USERNAME>/react-select/tree/master/packages/react-select
Failed with errors in 0s 290ms
(node:11491) UnhandledPromiseRejectionWarning: Error: react-
select#https://github.com/USERNAME/react-
select/tree/master/packages/react-select isn't supported by
any available resolver
i am using yarn 2.4.2
Has anyone dealt with this?
Any solution besides just copying the folder and installing it from a file path?
I had the same issue but upgrading to yarn version 2 worked. The following syntax for adding workspaces only starts working from yarn 2 on:
yarn add #react-select/monorepo#<GithubUsername>/react-select#head=<Name of branch>&workspace=react-select

npm script error while trying to install react-router-dom

While working on my react project, I just tried to install react-router-dom and somehow it seems it erased all my scripts and modules. Now I cannot run the server again no matter what I do. I also cleaned working directories and even deleted the branch, but it still doesn't work at all..
and below is the error message when I hit 'npm start'.
Although I don't know why installing react-router-dom removed all my packages, I reinstalled node modules and now it works again. :)

Resources