When I try to create react app on my Windows machine, I keep getting unauthorized access. I haven't experienced this behaviour on Mac, so I don't really know what might causing the issue.
In the VS Code's Terminal I ran following commands:
PS C:\Users\Foo_Bar\sandbox> npm install -g create-react-app
C:\Users\Foo_Bar\AppData\Roaming\npm\create-react-app -> C:\Users\Foo_Bar\AppData\Roaming\npm\node_modules\create-react-app\index.js
added 91 packages from 45 contributors in 6.923s
PS C:\Users\Foo_Bar\sandbox> create-react-app --version
create-react-app : File C:\Users\Foo_Bar\AppData\Roaming\npm\create-react-app.ps1 ca
nnot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ create-react-app --version
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\Foo_Bar\sandbox> create-react-app test-app
create-react-app : File C:\Users\Foo_Bar\AppData\Roaming\npm\create-react-app.ps1 ca
nnot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ create-react-app test-app
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\Foo_Bar\sandbox>
It looks like npm install -g create-react-app was successful. Creating the actual app or checking version failed, though. Does anyone have any idea what might be the reason of that?
EDIT:
Node and npm versions are following:
PS C:\Users\Foo_Bar\sandbox> node --version
v12.13.0
PS C:\Users\Foo_Bar\sandbox> npm --version
6.12.0
try using
npx create-react-app **foldername**
i had same problem and it was the faster and easier solution
Related
npm : The term 'npm' 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
+ npm start
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
while starting REACT app in browser using npm start
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
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.
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
Install failed. Rolling back...
Install-Package : Could not install package 'Twilio.AspNet.Mvc 5.0.1'. You are trying to install this package into a project that targets .NETFramework,Version=v4.5,
but
the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Twilio.AspNet.Mvc -Version 5.0.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Make sure that your Target Framework is at least 4.5.1
Use this command: Install-Package Twilio.AspNet.Mvc -DependencyVersion HighestMinor