{"record":{"id":"eb7ede339957f7bd","repo":"pnpm/pnpm","slug":"err-pnpm-no-script-eb7ede","errorCode":"ERR_PNPM_NO_SCRIPT","errorMessage":"Missing script: {_0:?}","messagePattern":"Missing script: (.+?)","errorType":"error_code","errorClass":"PackageManifestError::NoScript","httpStatus":null,"severity":"error","filePath":"pnpm/crates/package-manifest/src/lib.rs","lineNumber":73,"sourceCode":"        code(ERR_PNPM_PACKAGE_JSON_EXISTS),\n        help(\"Your current working directory already has a package.json file.\")\n    )]\n    AlreadyExist,\n\n    #[from(ignore)] // TODO: remove this after derive(From) has been removed\n    #[display(\"invalid attribute: {_0}\")]\n    #[diagnostic(code(ERR_PNPM_PACKAGE_MANIFEST_INVALID_ATTRIBUTE))]\n    InvalidAttribute(#[error(not(source))] String),\n\n    #[from(ignore)] // TODO: remove this after derive(From) has been removed\n    #[display(\"No package.json was found in {_0}\")]\n    #[diagnostic(code(ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND))]\n    NoImporterManifestFound(#[error(not(source))] String),\n\n    #[from(ignore)] // TODO: remove this after derive(From) has been removed\n    #[display(\"Missing script: {_0:?}\")]\n    #[diagnostic(code(ERR_PNPM_NO_SCRIPT))]\n    NoScript(#[error(not(source))] String),\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, IntoStaticStr)]\npub enum DependencyGroup {\n    #[strum(serialize = \"dependencies\")]\n    Prod,\n    #[strum(serialize = \"devDependencies\")]\n    Dev,\n    #[strum(serialize = \"optionalDependencies\")]\n    Optional,\n    #[strum(serialize = \"peerDependencies\")]\n    Peer,\n}\n\n#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]\n#[serde(untagged)]\npub enum BundleDependencies {\n    Boolean(bool),","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/pnpm/pnpm/blob/49dbe22c32011a09be9e7a4315c380a0415a944f/pnpm/crates/package-manifest/src/lib.rs#L55-L91","documentation":"This is `PackageManifestError::NoImporterManifestFound` from the `pnpm-package-manifest` crate (code `ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND`). Displayed as 'No package.json was found in {_0}', it signals that the operation expected an importer (project) manifest at a given directory and none exists. The string payload is the directory searched; it is a payload, not a wrapped source.","triggerScenarios":"A command or library call that needs to read/update a project manifest runs against a directory with no `package.json` (or none of the supported manifest filenames, e.g. `package.json5`/`package.yaml` depending on support) — for example `pnpm update` pointed at a directory outside any project, or a project path in the workspace glob that lacks a manifest.","commonSituations":"Running `pnpm update` in a freshly created, not-yet-initialized directory; a `packages/*` workspace glob matching an empty folder or a docs-only directory; running the command from the wrong subdirectory after `cd`; the manifest was deleted or gitignored.","solutions":["Run the command from the directory (or workspace root) that actually contains `package.json`.","Initialize the project first with `pnpm init` if the directory should be a package.","Fix the workspace `packages:` globs in `pnpm-workspace.yaml` so they don't match manifest-less directories (or add a `package.json` to that directory)."],"exampleFix":"// before\n$ cd packages/docs && pnpm update   # no package.json here\n// after\n$ pnpm --filter ./packages/app update","handlingStrategy":"validation","validationCode":"fn manifest_exists(dir: &std::path::Path) -> bool {\n    [\"package.json\", \"package.json5\", \"package.yaml\"]\n        .iter().any(|f| dir.join(f).is_file())\n}","typeGuard":null,"tryCatchPattern":"match update() {\n    Err(UpdateError::PackageManifest(PackageManifestError::NoImporterManifestFound(dir))) => {\n        eprintln!(\"no package.json in {dir}; run from a project dir or run `pnpm init`\")\n    }\n    other => other.expect(\"update failed\"),\n}","preventionTips":["Run `pnpm init` before dependency commands in new projects.","Verify cwd is a package directory (contains package.json) before scripted updates.","Keep workspace `packages:` globs tight so they match only real packages."],"tags":["file-not-found","package-json","manifest","workspace","rust"],"backgroundTag":"file-not-found","analyzedSha":"49dbe22c32011a09be9e7a4315c380a0415a944f","analyzedAt":"2026-09-15T20:33:00.202Z","contentChangedAt":"2026-09-15T20:33:00.202Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}