From 1be70914be65c9e3ace8be16b3e3e17f778f9d23 Mon Sep 17 00:00:00 2001 From: Nokome Bentley Date: Fri, 21 Feb 2020 17:42:54 +1300 Subject: [PATCH] fix(Package): Use prepare instead of postinstall This avoid the following error when installing Thema in another package: ```bash > @stencila/thema@1.6.0 postinstall /home/nokome/stencila/source/encoda/node_modules/@stencila/thema > npm run update > @stencila/thema@1.6.0 update /home/nokome/stencila/source/encoda/node_modules/@stencila/thema > npm run update:selectors && npm run update:examples && npm run update:themes && npm run update:extensions > @stencila/thema@1.6.0 update:selectors /home/nokome/stencila/source/encoda/node_modules/@stencila/thema > ts-node --files src/scripts/selectors.ts Error: Cannot find module '/home/nokome/stencila/source/encoda/node_modules/@stencila/thema/src/scripts/selectors.ts' ``` See https://docs.npmjs.com/misc/scripts --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2cc9f2997..f1fdbec7f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "main": "./dist/index.js", "scripts": { - "postinstall": "npm run update", + "prepare": "npm run update", "update": "npm run update:selectors && npm run update:examples && npm run update:themes && npm run update:extensions", "update:selectors": "ts-node --files src/scripts/selectors.ts", "update:examples": "ts-node --files src/scripts/examples.ts",