Skip to content

Error after stopping the dev server when run in an npm workspace #1459

@nswanberg

Description

@nswanberg

It's a minor issue, but I see this error when stopping the Observable dev server when the Observable project is in an NPM workspace:

^Cnpm ERR! Lifecycle script `dev` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: undefined 
npm ERR!   at location: /Users/nate/belle/github/test-workspace/projects/another-framework 
# Create workspace directory
mkdir test-workspace
cd test-workspace

# Initialize npm workspace
echo '{
  "name": "test-workspace",
  "version": "1.0.0",
  "private": true,
  "workspaces": [
    "projects/*"
  ]
}' > package.json

# Create Observable project directory
mkdir -p projects/my-observable-project
cd projects

# Create an Observable project with defaults (the error also happens with an empty Observable project)
npm init @observablehq

# ... answer setup questions ...

cd ./hello-framework

# Run observable
npm run dev

# Hit CTRL-c to quit and see the error above

Metadata

Metadata

Assignees

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