Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 9499498

Browse files
committed
Updated instllation page
Updated node docs This is part of pattern-lab/patternlab-node#70 for version 1.0.0 release prep
1 parent 77dce13 commit 9499498

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

patternlabsite/docs/installation.md

+47-10
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,60 @@ In order to install the PHP version of Pattern Lab, first make sure you have the
3434

3535
{% capture m %}
3636

37-
Installing the Node version of Pattern Lab with either a direct download from Github or by using `npm`.
37+
You can install the Node version of Pattern Lab a couple ways, and use either [grunt](http://gruntjs.com/) of [gulp](http://gulpjs.com/) to build and run the website. This page assumes that you have some familiarity with these tools, and can open the command line on your machine as administrator.
3838

39-
## Download
39+
## Prerequisites
4040

41-
1. Visit the [Pattern Lab Node project on Github](https://github.com/pattern-lab/patternlab-node).
42-
2. Download the Pattern Lab files either by [getting the a ZIP file of the project](https://github.com/pattern-lab/patternlab-node/archive/master.zip) or by cloning the project from the [Github repository](https://github.com/pattern-lab/patternlab-node).
43-
3. [Generate Pattern Lab Node for the first time](/docs/node/first-run.html).
41+
Make sure Node and npm are installed. A great guide can be found here: [https://docs.npmjs.com/getting-started/installing-node](https://docs.npmjs.com/getting-started/installing-node)
4442

45-
## npm
43+
## Download Options
4644

47-
1. Make sure Node and npm are installed. A great guide can be found here: [https://docs.npmjs.com/getting-started/installing-node](https://docs.npmjs.com/getting-started/installing-node)
48-
2. From the directory you want to install Pattern Lab within, run `npm install patternlab-node`
49-
3. [Generate Pattern Lab Node for the first time](/docs/node/first-run.html).
45+
* Download the [latest release of Pattern Lab Node](https://github.com/pattern-lab/patternlab-node/releases/latest) from Github
46+
* Via [npm](https://www.npmjs.com/), run `npm install patternlab-node` (Note this will auto install the grunt version currently. see below)
47+
* **NOTE** Node version 4.X and 5.X have tentative support, citing [a lot of Windows issues](https://github.com/nodejs/node-gyp/issues/629). Upgrade node at your own risk until otherwise stated. I've tried to catalog some issues and troubleshooting steps on the [wiki](https://github.com/pattern-lab/patternlab-node/wiki/Windows-Issues).
48+
49+
## Choose Your Adventure! Vanilla, Grunt & Gulp
50+
51+
The Node version of Pattern Lab ships with two `package.json` files, a `Gruntfile.js`, and a `gulpfile.js`. The default is grunt currently. The core builder is not dependent on either.
52+
53+
## Getting Started - grunt
54+
55+
To run the Node version of Pattern Lab using grunt, do the following in the directory you downloaded and extracted the zipped release:
56+
57+
1. Run `npm install` from the command line.
58+
2. Optionally, delete `package.gulp.json`, `gulpfile.js`, and `builder/patternlab_gulp.js` files if you are certain you don't need it.
59+
* Not deleting `builder/patternlab_gulp.js` may cause a harmless error when running grunt. Delete it.
60+
3. Run `grunt` or `grunt serve` from the command line.
61+
62+
This compiles all patterns, moves assets from `source/` to `public/`, and generates the website. It's strongly recommended to run `grunt serve` to have BrowserSync spin up and serve the files to you.
63+
64+
## Getting Started - gulp
65+
66+
To run the Node version of Pattern Lab using gulp, you need to swap out the default grunt configuration. Do the following in the directory you downloaded and extracted the zipped release:
67+
68+
1. Rename `package.json` to `package.grunt.json` or delete it if you don't intend on going back.
69+
2. Rename `package.gulp.json` to `package.json`.
70+
3. Run `npm install` from the command line.
71+
4. Run `gulp` or `gulp serve` from the command line.
72+
73+
This compiles all patterns, moves assets from `source/` to `public/`, and generates the website. It's strongly recommended to run `gulp serve` to have BrowserSync spin up and serve the files to you.
74+
75+
## Switching Between Grunt and Gulp
76+
77+
It's not expected to toggle between the two build systems, but for those migrating between the two configurations, here are some general guidelines:
78+
79+
* Make sure your `package.json` files are correct per the Getting Started sections.
80+
* Run `npm cache clear` before installation.
81+
* Delete the contents of `./node_modules` if you want a cleaner installation.
82+
* Regarding speed, Gulp is faster. BrowserSync takes a bit longer than the old static server to spin up, but its capabilities far outweigh the startup cost.
83+
84+
## Troubleshooting Installs
85+
86+
Make sure you are running your terminal/command line session as administrator. This could mean `sudo`, or opening the window with a right-click option.
5087

5188
{% endcapture %}
5289
{{ m | markdownify }}
5390

5491
</div>
5592

56-
<!--- end node -->
93+
<!--- end node -->

0 commit comments

Comments
 (0)