'BUILD_PATH' Creates Directory but Files are Empty - reactjs

I am trying to automate pushing my compiled code to my development server host.
My plan is to build the code from react-scripts and push it to my server's bare repo. But since the code itself is also under source control, I want the folder to be out of the source's main git.
I have set the BUILD_PATH option in my react-scripts (Windows environment):
"scripts": {
...
"buildStage": "set BUILD_PATH=../buildStage && react-scripts build"
}
When I run "buildStage" it compiles, and I can navigate to it in Windows File Explorer, the compiled file tree is there, but the folder size is 0 bytes.
Similarly, if I try to navigate there using Powershell, I get an error:
<user>: cd ../buildStage
cd : Cannot find path 'C:\Users\user\Documents\Code\src\buildStage' because it does not exist.
At line:1 char:1
+ cd x
+ ~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\user...s\Code\src\buildStage:String) [Set
-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
So apparently it doesn't find the build folder, despite having just built the code into it.
Has anyone experienced this and knows of a way through this?

Related

How to install neo4j.bat

I am trying to install neo4j.bat using the cmd: neo4j.bat install service. I am following a tutorial on this so I can use BloodHound on my windows machine.
when running this command I am getting an Error:
AuthorizedManager check faild.
CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : UnauthorizedAccess
Has anyone seen this or know how to get passed this.
Create a dummy folder anywhere C:\libraries and place bat file neo4j.bat in the created folder and add(append) the folder path C:\libraries\ to Path environment variable
For adding environment variable,
search for environment variable,
GO to User variables for YourAccountName, Select Path, Click Edit, Click on New > Paste C:\libraries\ without quotes > Click ok > Click ok
I ended up downloading a differnt version along with the desktop version. This seemed to work.

Expo CLI not recognised

im trying to create a new react-native app and to create it i need the expo CLI so i installed it via npm but then after trying to run expo init.... an error response occrured as the following:
expo : The term 'expo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
expo init _______
+ CategoryInfo : ObjectNotFound: (expo:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Would apperciate any help, Thanks.
If you could share additional screenshots that would be helpful.
One thing that is super easy to overlook is the path.
For example, you create a new folder "myApp"
Inside that folder you run npm install/expo init/etc.
What this does is creates another folder inside that one.
So your new path should be C://path/myApp/myApp
If you edit your question with screen shots/more info, then I can give a more detailed answer.
I had this issue before and here are some things to try:
install expo-cli globally (you dont explicitly state you've done this) npm i -g expo-cli
If you are using PowerShell and you are getting messages along the line of expo.ps1 cannot load because the execution of scripts is disabled on this system. you need to enable script execution. Decide on the script execution scope you want. Choices are Restricted (the current setting if you are getting this message), AllSigned, Unrestricted, and RemoteSigned (probably the one you want). Then open PowerShell as an admin and run
Set-ExecutionPolicy RemoteSign
Make sure npm is added to path (on Windows look for %USERPROFILE%\appData\Roaming\npm)
The classic uninstall, reboot, and reinstall

error while trying to install yarn in vscode when i had earlier been using npm

This is the error message
yarn : File C:\Users\Admin\AppData\Roaming\npm\yarn.ps1 cannot be loaded
because running scripts is disabled on this system. For more
information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
For those who are not aware of how to solve this error using Windows PowerShell
Open PowerShell (Run As Administrator)
Check the current execution policy using this command
Get-ExecutionPolicy
# You should get 'Restricted'
Run this command to make it 'Unrestricted'
Set-ExecutionPolicy Unrestricted
Check again whether execution policy changed by running this command
Get-ExecutionPolicy
You should get 'Unrestricted'
Now try to run nodemon on your project
nodemon 'filename.js'
Hope this would be helpful

Firebase login error in VS code (with React app) because running scripts is disabled

I was trying to deploy my react app to with firebase and this happened after puting thhis command in the terminal: firebase login
firebase : File C:\Users\hp\AppData\Roaming\npm\firebase.ps1 cannot be loaded because running scripts is disabled on d because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. .microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
firebase init
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Use git bash terminal to solve this issue
Using "cd" command navigate to your project directory
Instead of "firebase login" use "firebase login --interactive" in the git bash terminal.
Also I found that if you open git bash terminal in vs code you will not have issues navigating the interactive server options.
In VSCode Editor Terminal Select "Git Bash", refer the screenshot
and enter the run the command there.

How to clone Github to React Native Project

Im trying to clone github code (https://github.com/philnash/react-express-starter) to my react native project. However, When I run the command git clone https://github.com/philnash/react-express-starter.git in the terminal, I get the following error
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:1 char:1
+ git clone {https://github.com/philnash/react-express-starter.git}
+ ~~~
+ CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException`
I am pretty new to this and Im not sure why. Your help would be highly appreciated!
Make sure git is installed:
git --version
If git isn't installed that should give you an option to install it or visit https://git-scm.com/downloads

Resources