2015-10-10 04:40:57 +08:00
|
|
|
# Getting Started with N1 on Windows
|
|
|
|
|
|
|
|
## Dependencies
|
2016-10-13 07:37:04 +08:00
|
|
|
1. **Visual Studio 2013**: You must have Visual Studio 2013 installed to build
|
|
|
|
N1's native node modules. See the notes about Visual Studio below if you encounter compilation
|
|
|
|
errors. You can install [Visual Studio 2013 Community Edition](https://www.visualstudio.com/en-us/news/releasenotes/vs2013-community-vs) for free.
|
|
|
|
1. **Node**: You must have Node 4.x or Node 6.x to run N1's build script. Run `node -v` to check which version of NodeJS you are using.
|
2015-10-10 04:40:57 +08:00
|
|
|
1. **Python 2.7**: The `python` command must be on your `PATH` and must point to
|
|
|
|
Python 2.7 (not 3.x)
|
|
|
|
1. **Git**: The `git` command must be on your `PATH`
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
git clone https://github.com/nylas/N1.git
|
|
|
|
cd N1
|
2016-10-13 07:37:04 +08:00
|
|
|
npm config set msvs_version 2013 --global
|
2015-10-10 04:40:57 +08:00
|
|
|
script\bootstrap.cmd
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
|
|
|
electron\electron.exe . --dev
|
|
|
|
|
|
|
|
# Common Issues:
|
2016-10-13 07:37:04 +08:00
|
|
|
While `script\bootstrap.cmd` is designed to work out of the box, it needs to
|
|
|
|
compile native extensions with node-gyp. If `script\bootstrap.cmd` fails due
|
|
|
|
to a compilation error, it is likely a Visual Studio configuration issue.
|
2015-10-10 04:40:57 +08:00
|
|
|
|
2015-11-18 07:47:51 +08:00
|
|
|
## Visual Studio
|
2016-10-13 07:37:04 +08:00
|
|
|
There are several versions of Visual Studio. `node-gyp` is designed to detect
|
|
|
|
the current version installed on your system. Nylas N1 only officially supports
|
|
|
|
Visual Studio 2013. If you are using Visual Studio 2015, be sure you chose to
|
|
|
|
install the C++ features in the Visual Studio installer.
|
2015-10-10 04:40:57 +08:00
|
|
|
|
2016-10-13 07:37:04 +08:00
|
|
|
To ensure `node-gyp` uses Visual Studio 2013, run the following commands:
|
2015-10-10 04:40:57 +08:00
|
|
|
|
2016-10-13 07:37:04 +08:00
|
|
|
```
|
|
|
|
set GYP_MSVS_VERSION=2013
|
|
|
|
npm config set msvs_version 2013 --global
|
|
|
|
```
|
|
|
|
|
|
|
|
## Node & NPM
|
2015-10-10 04:40:57 +08:00
|
|
|
We only use your system's Node to bootstrap `apm`. Once we have `apm` installed,
|
|
|
|
your system's Node no longer matters and we install remaining packages with `apm`.
|
|
|
|
|
|
|
|
However, since bootstrapping this requires native extensions to be built, we need
|
|
|
|
a version of `node` and `node-gyp` that is compatible with your current Visual Studio
|
|
|
|
setup.
|
|
|
|
|
|
|
|
There is a small chance that depending on where you setup N1, you will get an
|
|
|
|
error about file paths being too long. If this happens, you will need to manually
|
|
|
|
install npm 3.x (npm 2.x comes shipped with most Node installations).
|
|
|
|
|
|
|
|
Instead of running the whole `script\bootstrap.cmd` script to test this, you can
|
|
|
|
`cd` into the `\build` folder, and from there run `npm install`. Only the
|
|
|
|
`build\package.json` modules need your system's Node.
|
|
|
|
|
2015-11-18 07:47:51 +08:00
|
|
|
## Python
|
2015-10-10 04:40:57 +08:00
|
|
|
The `python` executable must be on your `PATH`. Depending on how you installed Python,
|
|
|
|
you may need to ensure the `python.exe` can be found.
|