Comments (8)
@aikodeio
I had the same problem. Corrected combining with cross-env, like this:
{ "scripts": { "build": "cross-env BUILD_ENV=production gatsby build" } }
I hope this helps you.
from gatsby-env-variables.
I don't understand this step:
BUILD_ENV=staging yarn start
my package.json file has the following script:
...
"scripts": {
"develop": "gatsby develop",
"start": "npm run develop",
"build": "gatsby build",
"serve": "gatsby serve"
}
...
from gatsby-env-variables.
@luanbitar help plis :( thanks
from gatsby-env-variables.
Hi @aikodeio, you will tell what environment you want to build, you can do this when you will run the commands, like BUILD_ENV=staging yarn build
in your terminal if you want to build using staging config, or you can create a npm script to do this,
"scripts": {
"develop": "gatsby develop",
"start": "npm run develop",
"build": "gatsby build",
"build:staging": "BUILD_ENV=staging yarn build",
"serve": "gatsby serve"
}
Did you understand?
from gatsby-env-variables.
@luanbitar Thanks for answering me.
I am executing the following command in the console
BUILD_ENV=staging yarn build
but I get the following error:
"BUILD_ENV" is not recognized as an internal or external command,
program or executable batch file.
Do I need to add something else?
from gatsby-env-variables.
{
"name": "test-env",
"private": true,
"version": "1.0.0",
"dependencies": {
"gatsby": "^2.20.7",
"gatsby-env-variables": "^2.0.0",
"gatsby-image": "^2.3.1",
"gatsby-plugin-manifest": "^2.3.3",
"gatsby-plugin-offline": "^3.1.2",
"gatsby-plugin-react-helmet": "^3.2.1",
"gatsby-plugin-remove-trailing-slashes": "^2.2.1",
"gatsby-plugin-sharp": "^2.5.3",
"gatsby-source-filesystem": "^2.2.2",
"gatsby-transformer-sharp": "^2.4.2",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-helmet": "^5.2.1",
},
"devDependencies": {
"prettier": "^1.19.1"
},
"scripts": {
"develop": "gatsby develop",
"build": "gatsby build",
"build:staging": "BUILD_ENV=staging yarn build",
"build:production": "BUILD_ENV=production yarn build",
"serve": "gatsby serve"
}
}
from gatsby-env-variables.
@luanbitar excuse the insistence bro. But I cannot execute this
from gatsby-env-variables.
@lucasljsb Thank you! it worked perfectly
from gatsby-env-variables.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-env-variables.