Closed ph55 closed 11 months ago
Any update?
We have the same issue on Linux platforms.
node v18.13.0
npm v8.19.3
Not sure about any unintended consequences, but npm update
before the npm install
command seems to workaround the issue.
From our Dockerfile
:
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
# update as a workaround for:
# https://github.com/vercel/turbo/issues/5332
RUN npm update
RUN npm install
Since we are running update on the package.json
and package-lock.json
that turbo pruned and spat out, we think it should be fine, but needs more testing.
A few caveats:
npm update
will update to the latest within a semver range. We use exact versions, so not a big deal for us.--save=false
to override it being set in .npmrc
.npm update
is a slow operation, so it adds significant time to the image build process.I added this line to my Dockerfile
before running npm install
, and looks like the npm
version in node:18-alpine
is just plain old (8.19.3
).
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
RUN npm install --global npm@9.8.1
RUN npm install
With a newer npm
version it works great. Hope this helps.
Based on the comments above, it sounds like this is an npm issue rather than an issue with --prune
.
I'll close this out but please open a fresh issue if you're still running into this problem.
What version of Turborepo are you using?
1.10.3
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac
Describe the Bug
When one of the application in the workspace has local folder as a package -
npm install
will fail on "pruned"package-lock.json
with error:Expected Behavior
Turborepo should work with local folder npm package.
To Reproduce
npx create-turbo -e kitchen-sink
- use npmAdd local file system (folder) as a package to
api
application:Run
turbo prune --scope=api --docker
Copy
./out/json/
to./out2
Copy
./out/package-lock.json
to./out2/package-lock.json
Copy
./apps/api/src/vendor/test-package
to./out2/apps/api/src/vendor/test-package
Move
out2
outside of the project (mimic Dockerfile) Try tonpm i
Error will be thrown:
npm ERR! Cannot read properties of undefined (reading 'extraneous')
Reproduction Repo
No response