Closed tivac closed 6 years ago
I'm trying to run wright in an environment where there are a lot of NPM packages installed. It looks like something else I'm using depends on the pws package, because my directory ends up looking like this.
wright
pws
./node_modules ... ./pws ... ./wright ... ./node_modules ...
without a pws dir inside of ./node_modules/wright/node_modules.
./node_modules/wright/node_modules
This would normally be fine given node's package resolution semantics, but this line breaks things:
https://github.com/porsager/wright/blob/7efa2909a94c17cf6f82eee48af1283d7aa99572/lib/serve.js#L219
This can be fixed by replacing the line with
const pws = fs.readFileSync(require.resolve('pws/index.js'), 'utf8')
So that it is more resilient to npm's deduping.
Ah, thanks a lot Pat, that's much better!!
I'm trying to run
wright
in an environment where there are a lot of NPM packages installed. It looks like something else I'm using depends on thepws
package, because my directory ends up looking like this.without a
pws
dir inside of./node_modules/wright/node_modules
.This would normally be fine given node's package resolution semantics, but this line breaks things:
https://github.com/porsager/wright/blob/7efa2909a94c17cf6f82eee48af1283d7aa99572/lib/serve.js#L219
This can be fixed by replacing the line with
So that it is more resilient to npm's deduping.