File tree Expand file tree Collapse file tree
workspaces/arborist/lib/arborist Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ module.exports = cls => class Builder extends cls {
8989 const {
9090 depNodes,
9191 linkNodes,
92- storeNodes,
9392 } = this [ _retrieveNodesByType ] ( nodes )
9493
9594 // build regular deps
@@ -100,10 +99,6 @@ module.exports = cls => class Builder extends cls {
10099 this [ _resetQueues ] ( )
101100 await this [ _build ] ( linkNodes , { type : 'links' } )
102101 }
103- if ( storeNodes . size ) {
104- this [ _resetQueues ] ( )
105- await this [ _build ] ( storeNodes , { type : 'storelinks' } )
106- }
107102
108103 process . emit ( 'timeEnd' , 'build' )
109104 }
@@ -146,6 +141,12 @@ module.exports = cls => class Builder extends cls {
146141 depNodes . add ( node )
147142 }
148143 }
144+ // Make sure that store linked nodes are processed last.
145+ // We can't process store links separately or else lifecycle scripts on
146+ // standard nodes might not have bin links yet.
147+ for ( const node of storeNodes ) {
148+ depNodes . add ( node )
149+ }
149150
150151 // deduplicates link nodes and their targets, avoids
151152 // calling lifecycle scripts twice when running `npm rebuild`
@@ -162,7 +163,6 @@ module.exports = cls => class Builder extends cls {
162163 return {
163164 depNodes,
164165 linkNodes,
165- storeNodes,
166166 }
167167 }
168168
@@ -330,10 +330,12 @@ module.exports = cls => class Builder extends cls {
330330 devOptional,
331331 package : pkg ,
332332 location,
333+ isStoreLink,
333334 } = node . target
334335
335336 // skip any that we know we'll be deleting
336- if ( this [ _trashList ] . has ( path ) ) {
337+ // or storeLinks
338+ if ( this [ _trashList ] . has ( path ) || isStoreLink ) {
337339 return
338340 }
339341
You can’t perform that action at this time.
0 commit comments