From d75bfa15b2c08a7cc05cc2b12ca1c78d124988ba Mon Sep 17 00:00:00 2001 From: clement Date: Fri, 28 Aug 2020 10:53:29 +0200 Subject: [PATCH] fix node_modules paths, add eslint to devDeps --- cmd.js | 4 ++-- package.json | 1 + pkg-hacks.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd.js b/cmd.js index 4a6a260..c862c6d 100755 --- a/cmd.js +++ b/cmd.js @@ -136,7 +136,7 @@ function installShims ({ modules, overwrite }, done) { } parallel(shimPkgNames.map(function (name) { - var modPath = require.resolve(name) + var modPath = require.resolve(name, { paths: [path.join(__dirname.split('node_modules')[0], 'node_modules')] }) return function (cb) { fs.exists(modPath, function (exists) { if (!exists) return cb() @@ -260,7 +260,7 @@ function copyShim (cb) { function hackPackageJSONs (modules, done) { fixPackageJSON(modules, './package.json', true) - var finder = find('./node_modules') + var finder = find(path.join(__dirname.split('node_modules')[0], 'node_modules')) finder.on('file', function (file) { if (path.basename(file) !== 'package.json') return diff --git a/package.json b/package.json index 4dc0f91..6fa5bc1 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "precommit": "npm run lint" }, "devDependencies": { + "eslint": "^7.7.0", "husky": "^0.14.3" } } diff --git a/pkg-hacks.js b/pkg-hacks.js index 25f4dbd..0a26322 100644 --- a/pkg-hacks.js +++ b/pkg-hacks.js @@ -25,7 +25,7 @@ var path = require('path') // } module.exports = function hackFiles (hacks) { - var finder = find('./node_modules') + var finder = find(path.join(__dirname.split('node_modules')[0], 'node_modules')) hacks = hacks || hackers.map(h => h.name) finder.on('file', function (file) {