Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails when using npm workspaces #712

Closed
corey-aloia opened this issue Jun 20, 2024 · 2 comments
Closed

build fails when using npm workspaces #712

corey-aloia opened this issue Jun 20, 2024 · 2 comments

Comments

@corey-aloia
Copy link

Expected Behavior

Paketo does not seem to work with node workspaces. If I remove the workspace from my package.json, then it builds successfully.

  Executing launch environment install process
    Running 'npm ci --unsafe-perm --cache /layers/paketo-buildpacks_npm-install/npm-cache'
      
      added 104 packages, and audited 106 packages in 9s
      
      14 packages are looking for funding
        run `npm fund` for details
      
      found 0 vulnerabilities
failed to copy linked module directory to layer path: stat /workspace/app/incidents: no such file or directory

This looks very similar to this closed ticket here:
#498

I wasted a silly amount of time on this. I thought I had done something wrong, as I knew it had worked before. I ended up creating a whole new app, and by trial and error, found that be removing "workspaces" it will work.

  "workspaces": [
    "app/*"
  ],

The reason I assumed it was my fault, is because SAP has this buildpack in their official instructions. And setting up these workspaces is also done by default via the tools used. So really surprising that it just doesn't work.

For reference, I set up a new demo app, and build via:

pack build $CONTAINER_REGISTRY/incident-management-srv:1.3 \
    --path gen/srv \
    --builder paketobuildpacks/builder-jammy-base \
    --publish
@c0d1ngm0nk3y
Copy link
Contributor

Sorry for the delay @corey-aloia

I could not reproduce this problem and workspaces are working in general. There are some integration tests for this (e.g. here)

Given your input

"workspaces": [
    "app/*"
  ],

You have a folder called app with some subdirectories in it with are the workspaces, right? Does each of them has a package.json like described here?

Any change you still have code and can give us the structure (e.g. calling the tree command)?

@mhdawson
Copy link
Member

Since there has been no response from the original poster after the response from @c0d1ngm0nk3y, and @c0d1ngm0nk3y seems not to be able to reproduce I'm going to go ahead and close.

Please let us know if that was not the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants