From e190c10710eea5fadc56ee9e3dc553a9a48be59a Mon Sep 17 00:00:00 2001 From: V-V Date: Tue, 17 Apr 2018 10:52:41 +0300 Subject: [PATCH] Add Linux-specific installation details in README Instructions for running examples only applied to MacOS. Rather than introducing a new NPM dependency for running platform-specific commands, I thought it's simpler to just have own scripts for each platform. --- README.md | 15 ++++++++++++++- package.json | 3 ++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e1e236..2a95449 100644 --- a/README.md +++ b/README.md @@ -127,11 +127,24 @@ npm install --global babel-cli npm install --global webpack ``` +Some dependencies depend on native addon modules, so you'll also need to meet [node-gyp's](https://github.com/nodejs/node-gyp#installation) installation prerequisites. Therefore, Linux users may need to +``` +make clean && make +``` +to redo the local package-lock.json with working native dependencies. + ### Browser example +In macOS: ``` npm run build -npm run examples:browser +npm run examples:browser-macos +``` + +In Linux: +``` +npm run build +npm run examples:browser-linux ```

diff --git a/package.json b/package.json index 562c91c..d3b156d 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "scripts": { "examples": "npm run examples:node", "examples:node": "node examples/eventlog.js", - "examples:browser": "open examples/browser/browser.html", + "examples:browser-macos": "open examples/browser/browser.html", + "examples:browser-linux": "xdg-open examples/browser/browser.html", "test": "TEST=all mocha", "build": "npm run build:es5 && npm run build:debug && npm run build:dist && npm run build:examples", "build:examples": "webpack --config conf/webpack.example.config.js --sort-modules-by size && mkdir -p examples/browser/lib && cp node_modules/ipfs/dist/index.js examples/browser/lib/ipfs.js",