{"id":45896,"library":"pynpm","title":"pynpm","description":"A Python interface to NPM and package.json, providing utilities to run npm scripts and manage Node.js dependencies from Python. Version 0.3.0 is the latest, with infrequent releases.","status":"active","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/inveniosoftware/pynpm","tags":["npm","package.json","node","javascript"],"install":[{"cmd":"pip install pynpm","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"Prior to 0.2.0, the class was in pynpm.package.","wrong":"from pynpm.package import NPMPackage","symbol":"NPMPackage","correct":"from pynpm import NPMPackage"},{"note":"pnpm is a separate function, not an alias for npm.","wrong":"from pynpm import pnpm as npm","symbol":"pnpm","correct":"from pynpm import pnpm"}],"quickstart":{"code":"from pynpm import NPMPackage\n\npkg = NPMPackage('/path/to/project')\npkg.run_script('build')","lang":"python","description":"Create an NPMPackage instance pointing to a directory with package.json, then run an npm script."},"warnings":[{"fix":"Always pass a path to NPMPackage (e.g., NPMPackage('.')) for current directory.","message":"NPMPackage now requires a path argument; previously it defaulted to the current directory.","severity":"breaking","affected_versions":"0.2.0 and later"},{"fix":"Use pnpm() only if you have pnpm installed. For npm scripts, always use NPMPackage.","message":"pnpm() function is separate from npm; it executes pnpm not npm.","severity":"gotcha","affected_versions":"All"},{"fix":"Replace calls to pynpm.npm() with NPMPackage().run_script().","message":"The function pynpm.npm has been removed; use NPMPackage instead.","severity":"deprecated","affected_versions":"0.3.0"}],"env_vars":null,"search_vec":"'0.3.0':22 'depend':18 'infrequ':27 'interfac':4 'javascript':32 'latest':25 'manag':16 'node':31 'node.js':17 'npm':6,13,29 'package.json':8,30 'provid':9 'pynpm':1 'python':3,20 'releas':28 'run':12 'script':14 'util':10 'version':21","created_at":"2026-06-07T12:57:15.966652+00:00","updated_at":"2026-06-07T12:57:15.966652+00:00","problems":[{"fix":"Use from pynpm import NPMPackage and NPMPackage(path).run_script('script_name').","cause":"The pynpm.npm function was removed in 0.3.0.","error":"AttributeError: module 'pynpm' has no attribute 'npm'"},{"fix":"Install Node.js and npm, or ensure they are in your system PATH.","cause":"Node.js/npm is not installed or not in PATH.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'npm'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/inveniosoftware/pynpm","github":"https://github.com/inveniosoftware/pynpm","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}