mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* Add .nvmrc file * Update contributing docs * Fix typo in `nvm use` * Update "install node" text * Add test to ensure .nvmrc and .node-version are identical * Use async/await instead of promise * Feedback
This commit is contained in:
parent
f7eed88df5
commit
7b79d3aff5
3 changed files with 26 additions and 2 deletions
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
@ -0,0 +1 @@
|
|||
8.9.4
|
|
@ -152,10 +152,10 @@ git clone https://github.com/[YOUR_USERNAME]/kibana.git kibana
|
|||
cd kibana
|
||||
```
|
||||
|
||||
Install the version of node.js listed in the `.node-version` file _(this can be easily automated with tools such as [nvm](https://github.com/creationix/nvm) and [avn](https://github.com/wbyoung/avn))_
|
||||
Install the version of Node.js listed in the `.node-version` file. This can be automated with tools such as [nvm](https://github.com/creationix/nvm), [nvm-windows](https://github.com/coreybutler/nvm-windows) or [avn](https://github.com/wbyoung/avn). As we also include a `.nvmrc` file you can switch to the correct version when using nvm by running:
|
||||
|
||||
```bash
|
||||
nvm install "$(cat .node-version)"
|
||||
nvm use
|
||||
```
|
||||
|
||||
Install the latest version of [yarn](https://yarnpkg.com).
|
||||
|
|
23
src/dev/__tests__/node_versions_must_match.js
Normal file
23
src/dev/__tests__/node_versions_must_match.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import fs from 'fs';
|
||||
import { engines } from '../../../package.json';
|
||||
import { promisify } from 'util';
|
||||
const readFile = promisify(fs.readFile);
|
||||
import expect from 'expect.js';
|
||||
|
||||
describe('All configs should use a single version of Node', () => {
|
||||
it('should compare .node-version and .nvmrc', async () => {
|
||||
const [nodeVersion, nvmrc] = await Promise.all([
|
||||
readFile('./.node-version', { encoding: 'utf-8' }),
|
||||
readFile('./.nvmrc', { encoding: 'utf-8' }),
|
||||
]);
|
||||
|
||||
expect(nodeVersion.trim()).to.be(nvmrc.trim());
|
||||
});
|
||||
|
||||
it('should compare .node-version and engines.node from package.json', async () => {
|
||||
const nodeVersion = await readFile('./.node-version', {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
expect(nodeVersion.trim()).to.be(engines.node);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue