@@ -28,9 +28,9 @@ import { pluralize } from '@socketsecurity/registry/lib/words'
2828import constants from '../constants'
2929import { commonFlags } from '../flags'
3030import { safeReadFile } from '../utils/fs'
31+ import { shadowNpmInstall } from '../utils/npm'
3132import { getFlagListOutput } from '../utils/output-formatting'
3233import { detect } from '../utils/package-manager-detector'
33- import { shadowNpmInstall } from '../utils/shadow-npm'
3434
3535import type { CliSubcommand } from '../utils/meow-with-subcommands'
3636import type {
@@ -49,7 +49,7 @@ const {
4949 OVERRIDES ,
5050 PNPM ,
5151 RESOLUTIONS ,
52- SOCKET_CLI_UPDATE_OVERRIDES_IN_PACKAGE_LOCK_FILE ,
52+ SOCKET_CLI_IN_OPTIMIZE_CMD ,
5353 SOCKET_IPC_HANDSHAKE ,
5454 VLT ,
5555 YARN_BERRY ,
@@ -62,7 +62,7 @@ const NPM_OVERRIDE_PR_URL = 'https://github.com/npm/cli/pull/7025'
6262const PNPM_FIELD_NAME = PNPM
6363const PNPM_WORKSPACE = `${ PNPM } -workspace`
6464
65- const manifestNpmOverrides = getManifestData ( NPM ) !
65+ const manifestNpmOverrides = getManifestData ( NPM )
6666
6767type NpmOverrides = { [ key : string ] : string | StringKeyValueObject }
6868type PnpmOrYarnOverrides = { [ key : string ] : string }
@@ -930,10 +930,13 @@ export const optimize: CliSubcommand = {
930930 if ( isNpm ) {
931931 const ipc = {
932932 [ SOCKET_IPC_HANDSHAKE ] : {
933- [ SOCKET_CLI_UPDATE_OVERRIDES_IN_PACKAGE_LOCK_FILE ] : true
933+ [ SOCKET_CLI_IN_OPTIMIZE_CMD ] : true
934934 }
935935 }
936- await shadowNpmInstall ( { ipc } )
936+ await shadowNpmInstall ( {
937+ flags : [ '--ignore-scripts' ] ,
938+ ipc
939+ } )
937940 // TODO: This is a temporary workaround for a `npm ci` bug where it
938941 // will error out after Socket Optimize generates a lock file. More
939942 // investigation is needed.
0 commit comments