You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
▶ npm run-script dev --workspace=@project/api
npm ERR! missing script: dev
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/chance/.npm/_logs/2020-08-17T17_47_10_286Z-debug.log
I'm also not sure if NPM can pass arguments on to scripts. For example, I don't think this will work, right?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to specify a workspace for context on running scripts or commands?
For example, my package.json looks like this:
{ "name": "project", "private": true, "workspaces": [ "packages/*" ], "scripts": { "api": "yarn workspace @project/api", "web": "yarn workspace @project/web", "admin": "yarn workspace @project/admin", "core": "yarn workspace @project/core", "services": "yarn workspace @project/services", "mailer": "yarn workspace @project/mailer", "components": "yarn workspace @project/components", "hooks": "yarn workspace @project/hooks", "enums": "yarn workspace @project/enums", "management": "yarn workspace @project/management", "proto": "yarn workspace @project/proto", "socket": "yarn workspace @project/socket", "utils": "yarn workspace @project/utils" }so that I can run
yarn api devoryarn api add lodashedit:
I just found the the RFC for workspace commands.
I'm also not sure if NPM can pass arguments on to scripts. For example, I don't think this will work, right?
{ "scripts": { "api": "npm --workspace=@project/api", }npm run api install lodashI don't mind having to move the base package commands over to a Makefile but I will definitely need the
--workspaceflag to work.Beta Was this translation helpful? Give feedback.
All reactions