Reputation: 21
I install Gatsbyjs using:
npm install -g gatsby-cli
It installs and then when I try to create a new site it shows some error.
I have tried gastsby new gatsby-site
but it shows some errors:
PS C:\Users\Klawnny\Dropbox\ecommerce with react> npm install -g gatsby-cli C:\Users\Klawnny\AppData\Roaming\npm\gatsby -> C:\Users\Klawnny\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js
> [email protected] postinstall C:\Users\Klawnny\AppData\Roaming\npm\node_modules\gatsby-cli > node scripts/postinstall.js
+ [email protected] updated 1 package in 46.004s PS C:\Users\Klawnny\Dropbox\ecommerce with react> gatsby new lcoproject
File C:\Users\Klawnny\AppData\Roaming\npm\gatsby.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details. At line:1 char:7 + gatsby <<<< new lcoproject + CategoryInfo : NotSpecified: (:) [], PSSecurityException + FullyQualifiedErrorId : RuntimeException
I expected it to create the project but it shows this.
Upvotes: 2
Views: 2828
Reputation: 11
I've gotten the same issue a few times. How I fix it on windows 10 with PowerShell:
PS:C:\ Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
more info on Set-ExecutionPolicy
Upvotes: 1
Reputation: 1227
This helps me:
Set-ExecutionPolicy RemoteSigned
then type Y
Bump!!!
Run your Gatsby command again.
Upvotes: 1
Reputation: 47
Dude you have a typo. You typed gastsby
instead of gatsby
. Please be careful with the spellings.
Upvotes: -2
Reputation: 501
if you are using VS Code integrated terminal then a simple terminal setting will solve the issue.
File -> Preferences -> Settings
or use shortcut Ctrl + ,
to open settingsterminal.integrated.shellArgs.windows
, then on the result click on Edit in settings.json
settings.json
file "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"]
Upvotes: 6
Reputation: 49
It worked for me by using the powershell integrated console
Upvotes: 0
Reputation: 1
Sometimes I got issues running Gatsby on Windows. The way how I solved most of them was installing the Windows Subsystem for Linux. I really recommend you to do the same. The installation is pretty easy, take a look at this.
Upvotes: 0