Replies: 2 comments 1 reply
-
|
@nickBes, did you ever resolve this issue? |
Beta Was this translation helpful? Give feedback.
-
|
Hello! This is a known issue with Next.js in npm workspaces environments. Here are the proven solutions: Solution 1: Use NEXT_IGNORE_INCORRECT_LOCKFILE (Recommended) # In your build command
NEXT_IGNORE_INCORRECT_LOCKFILE=true turbo run build
# Or add to your .env file
NEXT_IGNORE_INCORRECT_LOCKFILE=trueSolution 2: Configure npm Workspace Properly {
"name": "monorepo-root",
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"build": "turbo run build"
}
}Solution 3: Update Next.js and Dependencies npm update next@latest
# Or in your app's package.json
"dependencies": {
"next": "^14.2.13"
}Solution 4: Custom Registry Configuration # .npmrc in your Next.js app directory
registry=https://your-private-registry.com
always-auth=trueSolution 5: Alternative Build Approach {
"scripts": {
"build:next": "cd apps/your-next-app && npm run build"
}
}The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hey, we're attempting to create a monorepo using turborepo and npm workspaces. One of our applications is a next js app, and when w'ere trying to run
turbo run buildfor this app, we are getting the next error:Found lockfile is missing swc dependencies, patching.... After that there's an attempt to install them from the npmjs package registry, which fails as we're working in closed network with our own registry.I believe this happens because in npm workspaces there's a single
package-lock.jsonfile for the root package.json which includes the dependencies for all of the packages in the workspaces. To actually test that, I copied the previouspackege-lock.json(from the previous repository) and the build finished successfully...Sometimes I also got the next error (which could actually relate to this thread):
Additional information
Can't bring screenshots / errorsExample
No response
Beta Was this translation helpful? Give feedback.
All reactions