https://github.com/toatoes/react-learning
React.js
https://github.com/toatoes/react-learning
reactjs
Last synced: 11 months ago
JSON representation
React.js
- Host: GitHub
- URL: https://github.com/toatoes/react-learning
- Owner: ToaToes
- Created: 2024-09-25T03:18:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T03:15:38.000Z (almost 2 years ago)
- Last Synced: 2025-02-27T16:52:28.469Z (over 1 year ago)
- Topics: reactjs
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React
## React to start with (on Mac)
### Homebrew file management:
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
permission needed (Sudo)
```
brew intsall Node
```
### Node package management:
Note:
"npm install -g create-react-app" no longer supported
"https://dev.to/ag2byte/create-react-app-is-officially-dead-h7o"
"-g" -> perform globally
```
npm cache clean --force
```
https://stackoverflow.com/questions/51607362/please-run-npm-cache-clean
To clean old packs:
```
npm uninstall -g create-react-app
```
### Vite for creating React app
Download Vite for createing react apps
```
npm create vite@latest
```
Select frameworks -> React
Select language -> Typescript/Javascript
Then run:
```
cd [Filename]
npm install
npm run dev
```
## React to start with (on WIN)
## Solution encountering problems
Note: show hidden files for mac: https://support.carbonite.com/articles/Personal-Pro-Mac-Displaying-Hidden-Library-Folder
Sudo causing problems: Permission denied for altering js files
https://stackoverflow.com/questions/51967335/npm-install-permission-denied-macos
To check the location of the package:
```
npm config get prefix
```
Delete Node Modules OR Reinstall Node if still not working
Then direct to the project path, Check the permissions of your project directory:
```
ls -l /path_to_project
```
Ensure that user has the appropriate permissions. change the ownership:
```
sudo chown -R $(whoami) /path_to_project
```
## Reinstall
```
brew uninstall node
```
check versions
```
node -v
npm -v
```
clean up any unused dependencies or old versions of packages with:
```
brew cleanup
```
## Git
Basic:
https://www.youtube.com/watch?v=i_23KUAEtUM
Problems:
https://www.studocu.com/en-au/messages/question/8509507/in-visual-studio-code-what-does-git-fatal-head-is-not-a-commit-and-branch-cannot-be-created