@@ -7,7 +7,6 @@ const pacote = require('pacote')
77const promiseAllRejectLate = require ( 'promise-all-reject-late' )
88const runScript = require ( '@npmcli/run-script' )
99const { callLimit : promiseCallLimit } = require ( 'promise-call-limit' )
10- const { checkEngine, checkPlatform } = require ( 'npm-install-checks' )
1110const { depth : dfwalk } = require ( 'treeverse' )
1211const { dirname, resolve, relative, join } = require ( 'node:path' )
1312const { log, time } = require ( 'proc-log' )
@@ -228,18 +227,6 @@ module.exports = cls => class Reifier extends cls {
228227 this . idealTree . meta . hiddenLockfile = true
229228 this . idealTree . meta . lockfileVersion = defaultLockfileVersion
230229
231- // Preserve inertness for failed stuff.
232- if ( this . actualTree ) {
233- for ( const [ loc , actual ] of this . actualTree . inventory . entries ( ) ) {
234- if ( actual . ideallyInert ) {
235- const ideal = this . idealTree . inventory . get ( loc )
236- if ( ideal ) {
237- ideal . ideallyInert = true
238- }
239- }
240- }
241- }
242-
243230 this . actualTree = this . idealTree
244231 this . idealTree = null
245232
@@ -566,9 +553,6 @@ module.exports = cls => class Reifier extends cls {
566553 // retire the same path at the same time.
567554 const dirsChecked = new Set ( )
568555 return promiseAllRejectLate ( leaves . map ( async node => {
569- if ( node . ideallyInert ) {
570- return
571- }
572556 for ( const d of walkUp ( node . path ) ) {
573557 if ( d === node . top . path ) {
574558 break
@@ -662,18 +646,7 @@ module.exports = cls => class Reifier extends cls {
662646 const timeEnd = time . start ( `reifyNode:${ node . location } ` )
663647 this . addTracker ( 'reify' , node . name , node . location )
664648
665- const { npmVersion, nodeVersion, cpu, os, libc } = this . options
666649 const p = Promise . resolve ( ) . then ( async ( ) => {
667- // when we reify an optional node, check the engine and platform
668- // first. be sure to ignore the --force and --engine-strict flags,
669- // since we always want to skip any optional packages we can't install.
670- // these checks throwing will result in a rollback and removal
671- // of the mismatches
672- // eslint-disable-next-line promise/always-return
673- if ( node . optional ) {
674- checkEngine ( node . package , npmVersion , nodeVersion , false )
675- checkPlatform ( node . package , false , { cpu, os, libc } )
676- }
677650 await this [ _checkBins ] ( node )
678651 await this . #extractOrLink( node )
679652 const { _id, deprecated } = node . package
@@ -707,10 +680,6 @@ module.exports = cls => class Reifier extends cls {
707680 }
708681
709682 async #extractOrLink ( node ) {
710- if ( node . ideallyInert ) {
711- return
712- }
713-
714683 const nm = resolve ( node . parent . path , 'node_modules' )
715684 await this . #validateNodeModules( nm )
716685
@@ -791,7 +760,7 @@ module.exports = cls => class Reifier extends cls {
791760 [ _handleOptionalFailure ] ( node , p ) {
792761 return ( node . optional ? p . catch ( ( ) => {
793762 const set = optionalSet ( node )
794- for ( node of set ) {
763+ for ( const node of set ) {
795764 log . verbose ( 'reify' , 'failed optional dependency' , node . path )
796765 node . ideallyInert = true
797766 this [ _addNodeToTrashList ] ( node )
@@ -1165,9 +1134,6 @@ module.exports = cls => class Reifier extends cls {
11651134
11661135 this . #retiredUnchanged[ retireFolder ] = [ ]
11671136 return promiseAllRejectLate ( diff . unchanged . map ( node => {
1168- if ( node . ideallyInert ) {
1169- return
1170- }
11711137 // no need to roll back links, since we'll just delete them anyway
11721138 if ( node . isLink ) {
11731139 return mkdir ( dirname ( node . path ) , { recursive : true , force : true } )
0 commit comments