turbo: [turborepo] NPM error code ENOWORKSPACES with NextJS
What version of Turborepo are you using?
1.8.3
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac
Describe the Bug
Performing turbo run dev on the latest NextJS version (13.2.4) causes the ENOWORKSPACES npm error during startup.
error code ENOWORKSPACES
error This command does not support workspaces.
Expected Behavior
No errors
To Reproduce
Clone the reproduction repo, run npm install and npm run dev. In the apps directory I setup two barebones nextjs starters. latest causes the issue and older does not.
This is happening for me on node version 18.15.0 and NPM version 9.6.1.
Reproduction Repo
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 15
- Comments: 26 (5 by maintainers)
Commits related to this issue
- Update README.md https://github.com/vercel/turbo/issues/4183 — committed to launchdarkly/js-core by yusinto 3 months ago
use
npx next telemetry disablefrom https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345
I run into the same issue when creating a completely empty repo using
npx create-turbo@latest my_repoand runningnpm run dev.npx next telemetry disableworked for meSame error using
"turbo": "^1.9.3""packageManager": "npm@9.5.1",and using node -vv18.16.0Seeing this as well after upgrading to Next 13.2.4 from Next 13.1.6. Downgrading Next.js made it go away again. Turbo version is 1.8.3. Node is 18.15.0 with npm 9.5.0.
Same error here as well:
Sorry for the spam, but also want to mention here that I just tried running a fresh
13.2.4nextjs app standalone (not using turbo or workspaces) and I am not seeing the error thrown anywhere.This error happens when a nextjs (versions after
13.1.6) dev server runs in an npm workspace.same error as well
Also getting this same error with:
We have workspaces setup in the
package.jsonand in thepnpm-workspace.yamlI do not have any global .npmrc or config setup (fresh default node/NPM install). I’m surprised you didn’t get any error, do you have a .npmrc? @nathanhammond
Looks like a few others are also seeing this while using storybook.
https://github.com/storybookjs/storybook/issues/20726
Seems like the npm config command being used (which doesn’t support workspaces) could be the cause.
https://docs.npmjs.com/cli/v9/commands/npm-config
Hey @joepetrillo! I pulled down your repository and it doesn’t reproduce for me.
That error is thrown here: https://github.com/npm/cli/blob/618c1baa830b0ab52fbee0016c3532411477bde7/lib/base-command.js#L122-L126
And the cause of that is one of the 28 commands that exist in
npmthat do not support workspaces. My only hypothesis is that it is possible that you have a global.npmrcthat is causing this failure.As I can’t reproduce I’m going to close this for now. Do let us all know if you get it figured out!