CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-nodeenv

tessl install tessl/pypi-nodeenv@1.9.0

Node.js virtual environment builder for creating isolated Node.js environments

Agent Success

Agent success rate when using this tile

80%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.25x

Baseline

Agent success rate without this tile

64%

task.mdevals/scenario-4/

NPM Version Manager

A command-line tool that manages npm installations across different versions in isolated environments.

Capabilities

Install specific npm version

  • When the user runs the tool with --npm-version 8.19.2, it installs exactly npm version 8.19.2 in the target directory @test
  • When the user runs the tool with --npm-version latest, it fetches and installs the latest available npm version @test

Handle legacy npm versions

  • When installing npm version 0.3.18, the tool uses the correct installation command for legacy versions @test
  • When installing npm version 1.0.0 or higher, the tool uses the modern installation command @test

Manage npm environment isolation

  • After installation, the tool sets the NPM_CONFIG_PREFIX environment variable to point to the installation directory @test
  • The tool configures the npm_config_prefix (lowercase) variable for backward compatibility @test

Cleanup legacy installations

  • When the --cleanup-legacy flag is set and npm 0.x is detected, the tool removes old npm 0.x artifacts before installing @test
  • When the --cleanup-legacy flag is not set, the tool skips cleanup operations @test

Implementation

@generates

API

def install_npm(target_dir: str, npm_version: str, cleanup_legacy: bool = True) -> None:
    """
    Installs the specified npm version into the target directory.

    Args:
        target_dir: Directory where npm should be installed
        npm_version: Version string (e.g., '8.19.2', 'latest')
        cleanup_legacy: Whether to cleanup legacy npm 0.x installations

    Raises:
        ValueError: If target_dir doesn't exist or npm_version is invalid
        RuntimeError: If installation fails
    """
    pass

def get_latest_npm_version() -> str:
    """
    Fetches the latest npm version from the npm registry.

    Returns:
        Version string of the latest npm release

    Raises:
        RuntimeError: If unable to fetch version information
    """
    pass

def set_npm_environment(target_dir: str) -> dict:
    """
    Creates environment variables for npm isolation.

    Args:
        target_dir: The npm installation directory

    Returns:
        Dictionary of environment variables to set
    """
    pass

def cleanup_npm_legacy(target_dir: str) -> None:
    """
    Removes legacy npm 0.x installation artifacts.

    Args:
        target_dir: Directory containing the npm installation
    """
    pass

Dependencies { .dependencies }

nodeenv { .dependency }

Python package for Node.js virtual environment management with npm installation capabilities.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/nodeenv@1.9.x
tile.json