How to create react app without git (skipping git)? - javascript

I don't want git initialized in my folder when I create react app by
npx create-react-app appName
When I was working with Angular, it was comparatively easier by just typing the command
ng new my-app --skip-git
Can anyone please tell me the related command for React? I tried searching but couldn't find any satisfactory answer.

There's an open GitHub issue for your case.
TL;DR: There are no current plans to include such an option. The React developers recommend you run rm -rf .git after npx create-react-app appName to achieve these results.

I had case where I have nodejs folder and I wanted to create react frontend project folder inside react project folder. I did it using this command npx create-react-app projectname --skip-git

Try npx create-react-app --skip-git.
If this is not working delete the .git folder manually .

Related

Can I run git clone via an NPX tool

Im in the process of building a custom NPX tool which will add my custom npm package into a local hosted server,
I have as of right now a template of the structure id like to replicate when other users run my NPX command, something along the lines of
src
index.js
build
built_js.js
styles
styles.css
I understand when it comes to npm packages ill have to run these commands separately which is fine but im wondering how i can rebuild this directory on command npx create-my-app
yes you can!
try to use this package for it:
https://www.npmjs.com/package/create-clone

how to setup a project to develop on a npm package

I have a git root project where I am using inside my root project a git subproject.
So for example I have the project MyApp and a subproject UIComponents.
Currently I have cloned the UIComponents repo into my project folder and added UIComponents to .gitignore of the root project.
Now I want to build a npm package for UIComponents and I want to be able to switch between npm production build and development.
The problem is in development the import is this:
import Button from './UIComponents'
and with the npm package the import is this:
import Button from '#my_name/UIComponents'
I dont want to adjust the imports everytime.
The first thought that comes to mind is to develop the UIComponents inside node_modules folder but this seems not to be a nice solution.
For solving this, try to use npm link.
So instead of cloning it in a subdirectory that need to be added to gitignore, just check out the repository outside of you project and then link it.
Example:
cd ~/projects/UIComponents
npm link
cd ~/projects/MyApp
npm link #my_name/UIComponents
In this way you can use the same import syntax but you can develop locally in both projects at the same time without the need of publishing every change.

public, src,and scripts folder not created while installing react-app

npx create-react-app clientwhen I tried to install react app using npx the files src, public folder are not created cmd is shown below
My react installation not being successful. Its been 2-3 days I'm searching for solution gone through many solutions but it didn't work as expected.
You should update node.js and react-app.
Seeing this maybe useful.

'vue' is not recognized as an internal or external command

everything was installed correctly. but whenever I try to create project, it says "'vue' is not recognized as an internal or external command". I installed and re-installed but didn't work. npm was also added to environmental variable path.
C:\Users\touha\Desktop>npm list -g --depth=0
C:\Users\touha\.npm-packages
`-- #vue/cli#3.8.2
C:\Users\touha\Desktop>vue ui
'vue' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\touha\Desktop>
Locate vue.cmd and add its location to your PATH
It is added to package manager(npm or yarn) installation. So you may find it at following locations
YARN
C:\Users{YourAccount}\AppData\Local\Yarn\bin
NPM
C:\Users{YourAccount}\AppData\Roaming\npm
just open PowerShell and run: npm install -g #vue/cli
Addition: If setting the path variable and reinstalling #vue/cli does not work, using the node.js command prompt instead might solve the issue.
It seems vue isn't been installed globally for some reasons.
This is the step I followed to solve mine:
Firstly, create your desired project folder (say "Vue Project"). This is where you want to create a vue project.
Then create a "node_modules" folder in the Vue Project folder
Then go to your system npm folder C:\Users{YourAccount}\AppData\Roaming\npm
You will see three different "vue" files. Copy them and paste in the Vue Project Folder you created.
Go back to C:\Users{YourAccount}\AppData\Roaming\npm and enter the node_modules folder. You'll see a "#vue" folder. Copy this, and paste it in the node_modules folder you created in the Vue Project Folder.
You can now head back to the CLI and create your project using "vue create my-vue-project" where my-vue-project is your desired vue project name.
You can try this way it worked for me
go to the location of your yarn or npm mine is C:\Users\TED\AppData\Local\Yarn\bin for Yarn
C:\Users\TED\AppData\Local\Npm\bin for Npm users
TED will be replaced by your user name
then copy and add it to your system environment variable
Note in case you don't find AppData make sure you have view hidden file checked
I am using Yarn to install #vue/cli.
The way I solve it is via the following steps
Locate your global installed vue.cmd location
Add the vue.cmd directory into System variable Env. For myself, the path is C:\Users{MyAccount}\AppData\Local\Yarn\.bin
what worked for me:
In a powershell :
npm install vue
npm install -g #vue/cli
C:\Users\{USER}\AppData\Roaming\npm\vue.cmd create {NAME}
if you got this error most probably chance package not installed completely
check-in C:\Users\dev\AppData\Roaming\npm
if you had not found the package under this folder then re-run your command
Run command prompt as administrator
Run setx /M path "%path%;%appdata%\npm
Restart the command prompt
Now create the Vue project

Gulp.js GUI with Electron

I have been planning to start working on a new application for my current college project. What I would like to do is create an electron app that will start specific tasks based on a gulpfile.js.
This is mostly to let people start the gulp tasks even if they aren't used to work with the terminal .
Now the question is: If I package the application (macOS) and the final user don't have any node/gulp.js installed globally, will this work? Is it possible to package an electron app with gulp and fire some gulp taks anyway?
I don't have enough time to start the project without knowing if it will work, that's why I'm addressing this to you guys, I need your help in the subject :)
I have also searched on Google for some solutions, but I didn't find any.
Thank you!
I don't know about gulp in particular, but as it seems to be an npm module, you'll be able to install it locally with your electron app. In the terminal cd to your electron/resources/app folder and run
npm install gulp-cli -g
npm install gulp -D
(as shown on https://gulpjs.com/)
You then should see a node_modules folder in the same directory, which contains the install of gulp. This can then be packaged in the same way as any other electron app.

Categories

Resources