Skip to content

socket-npm throws "rawBinArgs.findLast is not a function" #911

@pimterry

Description

@pimterry

Clean global install of the latest version (v1.1.28). I manage npm through fnm which might be relevant. This is using Node v22.20.0 on Linux.

➜ socket-npm      
/home/tim/.local/share/fnm/node-versions/v22.20.0/installation/lib/node_modules/@socketsecurity/cli/dist/shadow-npm-bin2.js:44
  const nodeOptionsArg = rawBinArgs.findLast(agent.isNpmNodeOptionsFlag);
                                    ^

TypeError: rawBinArgs.findLast is not a function
    at shadowNpmBase (/home/tim/.local/share/fnm/node-versions/v22.20.0/installation/lib/node_modules/@socketsecurity/cli/dist/shadow-npm-bin2.js:44:37)
    at shadowNpmBin (/home/tim/.local/share/fnm/node-versions/v22.20.0/installation/lib/node_modules/@socketsecurity/cli/dist/shadow-npm-bin2.js:95:16)
    at /home/tim/.local/share/fnm/node-versions/v22.20.0/installation/lib/node_modules/@socketsecurity/cli/bin/npm-cli.js:14:34
    at Object.<anonymous> (/home/tim/.local/share/fnm/node-versions/v22.20.0/installation/lib/node_modules/@socketsecurity/cli/bin/npm-cli.js:29:3)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)

Node.js v22.20.0

Same for socket-npx. Meanwhile socket npm and socket npx do work fine - but that's not what the safe-npm faq recommends as a npm alias. I'm not sure what the difference is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions