-
Notifications
You must be signed in to change notification settings - Fork 6
BUG: Dependencies used in postinstall
are unavailable when "flattened" to higher directory.
#23
Comments
This is a more generic problem with flattening (in apparently npmv2 or npmv3). Faster repro:
Note: That all npmv3 // REDOING npmv2 $ npm install ~/scm/fmd/builder-npm3-postinstall-bug-app/
> which builder || echo 'ERROR: ONE'
/Users/rye/Desktop/builder-npm3-testing/node_modules/builder-npm3-postinstall-bug-app/node_modules/builder-npm3-postinstall-bug-one/node_modules/.bin/builder
> which builder || echo 'ERROR: TWO'
/Users/rye/Desktop/builder-npm3-testing/node_modules/builder-npm3-postinstall-bug-app/node_modules/builder-npm3-postinstall-bug-two/node_modules/.bin/builder
> which builder || echo 'ERROR: APP'
/Users/rye/Desktop/builder-npm3-testing/node_modules/builder-npm3-postinstall-bug-app/node_modules/.bin/builder So, same output in both cases. Now, let's make all npmv3 // REDOING npmv2 $ npm install ~/scm/fmd/builder-npm3-postinstall-bug-app/
> which builder || echo 'ERROR: ONE'
ERROR: ONE
> which builder || echo 'ERROR: TWO'
ERROR: TWO
> which builder || echo 'ERROR: APP'
/Users/rye/Desktop/builder-npm3-testing/node_modules/builder-npm3-postinstall-bug-app/node_modules/.bin/builder So the conclusion at this point is that on installs of probably any kind and for npm v2 or v3 we need to detect:
|
maybe archetypes have their own |
@boygirl -- I'm saying " |
git
-sourced dependency fails to find webpack
, builder
scripts on npm install
postinstall
are unavailable when "flattened" to higher directory.
but what if the postinstall for the consuming package expected a path relative to the consuming package |
Our current understanding of the issue is that So how can we get this config path to work, without resorting to writing all our tasks in JS? A couple proposals, which both rely on preprocessing the script command:
|
New implementation update:
Status: Webpack build is failing with these stats:
Failing with:
This actually looks right. Investigating more. |
* Revises `PATH`, `NODE_PATH` ordering to place archetype first, then root project. * Add `--expand-archetype` flag to expand `node_modules/<archetype` tokens in task strings. Fixes FormidableLabs/builder-victory-component#23 * Refactors `config.js` to streamline package.json ingestion and pass back more data. * Updated docs and lots of tests.
* Revises `PATH`, `NODE_PATH` ordering to place archetype first, then root project. * Add `--expand-archetype` flag to expand `node_modules/<archetype` tokens in task strings. Fixes FormidableLabs/builder-victory-component#23 * Refactors `config.js` to streamline package.json ingestion and pass back more data. * Updated docs and lots of tests.
Reproduction:
package.json
with code provided below.npm install
Diagnosis
Guesses:
npm v3
tree flattening and git install somehow keeping things nested in an unexpected way../
toNODE_PATH
and../.bin
toPATH
.Observations:
npm
installed packages (victory-animation
,victory-label
) havelib/
, so they're just not hitting thebuilder run npm:postinstall
step.victory-util
does not havelib/
(which is expected since it's git installed).npm
installed packages (victory-animation
,victory-label
) have a containednode_modules/builder
installation.victory-util
does not.package.json
Errors
Cannot Find Webpack in Archetype
Cannot Find Local Builder
The text was updated successfully, but these errors were encountered: