Windows Development¶
Our build does not run natively on Windows due to its requirement of a POSIX shell and some of
the core utilities such as cat
, cp
, echo
, ect. However, you can build and develop
OpenSphere on Windows with any of the following:
- Git Bash (included with Git for Windows)
- Cygwin
- Windows Subsystem for Linux
- Docker
- Linux VM
These instructions will take the simplest approach by using Git Bash.
Prerequisites¶
Install git, java, node, and yarn. We recommend using Chocolatey, a package manager for Windows. After installing Chocolatey, run the following in a command prompt as an administrator:
choco install git jre8 nvm yarn
refreshenv
nvm install 10.16.2
nvm use 10.16.2
Now we will check our work:
git --version
java -version
node --version
npm --version
yarn --version
Git for Windows installs “Git Bash”. Search for it in the Start Menu and fire it up.
npm¶
Tell the NPM script runner to use BASH rather than whatever it typically uses on Windows.
npm config set script-shell "C:/Program Files/git/bin/bash.exe"
If you have other node projects on your machine and do not wish for this to pollute them, then consider adding
that configuration to a .npmrc
file local to the project.
git¶
Fix your line ending configuration for git (necessary if using Git Bash but not if you are using a full POSIX environment such as Cygwin):
git config core.autocrlf input
OpenSphere¶
Now set up the project workspace and clone the project:
cd <your workspace directory>
git clone https://github.com/ngageoint/opensphere-yarn-workspace
cd opensphere-yarn-workspace/workspace
git clone https://github.com/ngageoint/opensphere
yarn install
cd opensphere
Now build:
yarn build
# or
npm run build
Note
Yarn has a bug involving the use of the script-shell config with some older combinations of yarn/node. Please ensure that you are using the latest Yarn and also Node 12+.