Skip to content

'socket npm' overrides NODE_OPTIONS #1036

@pimterry

Description

@pimterry

To demo, in package.json:

  "scripts": {
    "echo": "echo $NODE_OPTIONS",
  }

Running npm directly:

➜ NODE_OPTIONS=test npm run echo

> echo
> echo $NODE_OPTIONS

test

Running with socket-cli:

➜ NODE_OPTIONS=test socket npm run echo
   _____         _       _        /---------------
  |   __|___ ___| |_ ___| |_      | CLI: v1.1.34
  |__   | . |  _| '_| -_|  _|     | token: (not set), org: (not set)
  |_____|___|___|_,_|___|_|.dev   | Command: `socket npm`, cwd: ~/.../


> echo
> echo $NODE_OPTIONS

'--permission --allow-child-process --allow-fs-read=* --allow-fs-write=/home/.../* --allow-fs-write=/home/.../npm-installation/* --allow-fs-write=/home/.../.npm/*'

This makes it impossible to use socket npm as a drop in replacement if you configure NODE_OPTIONS globally, since any such kind of configuration is ignored.

Imo Socket should include globally set options in addition to it's own additions - it shouldn't replace them entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions