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

[BUG] #7495 Partially fixes #7413, but running scripts for workspaces in the / directoy is still broken. #7563

Open
2 tasks done
jAg-upfort opened this issue May 28, 2024 · 3 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@jAg-upfort
Copy link

jAg-upfort commented May 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

This is a direct follow-on/reopen of #7413. It was hoped that this was fixed in 10.8.0 with #7495, however, this fix is not sufficient, and I've updated the project files to show this.

npm as of version 10.5.2 no longer lets you run scripts in a workspace package.json if your project is located at /. I've confirmed it worked in 10.5.1.
image

The specific error is the same:

...
> [7/8] RUN npm run -w packages/workspace build:                                                                                                                                                                    
1.304 npm error No workspaces found:                                                                                                                                                                                 
1.304 npm error   --workspace=packages/workspace
1.306 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-05-28T10_57_18_985Z-debug-0.log
------
Dockerfile.txt:15
--------------------
  13 |     RUN echo $(npm --version)
  14 |     
  15 | >>> RUN npm run -w packages/workspace build
  16 |     
  17 |     ENTRYPOINT ["bash"]
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run -w packages/workspace build" did not complete successfully: exit code: 1

I've included a zipped project, the 4 individual files and a screenshot of the project with all the files in their entirety visible. The top level package.json has scripts to build the dockerfile in ways that show the bug and that it's a regression.

image
npm-bug-example-update.zip

package.json
Dockerfile.txt
package-lock.json
package.json

Expected Behavior

The Dockerfile should build, and not fail due to being unable to find the workspace. This works successfully in 10.5.1, but does not work in 10.5.2, 10.6.0, 10.7.0, and 10.8.0

Steps To Reproduce

Both validations assume the project has been unzipped from the uploaded archive or recreated with the raw files in the right places, that docker is installed, and that the testing environment has an internet connection for downloading the base docker images.

I have personally only run this on an Ubuntu system, so Windows or mac users might have other setup requirements.

To validate the issue:

  1. run npm run npm-unfixed

To validate that things work in 10.5.1:

  1. run npm run npm-good

Environment

  • npm: 10.8.0
  • Node.js: node 18 or 20 will hit this issue. I didn't test any other releases
  • OS Name: whatever the node:iron and node:hydrogen dockerfiles use, but i've also recreated the issue with ubuntu:jammy and postgres:15-bullseye for shiggles as part of debugging the issue in my actual environment
  • System Model Name: ?
  • npm config:
#10 [6/7] RUN npm config ls
#10 1.001 ; node bin location = /usr/local/bin/node
#10 1.001 ; node version = v20.13.1
#10 1.001 ; npm local prefix = /
#10 1.001 ; npm version = 10.8.0
#10 1.001 ; cwd = /
#10 1.001 ; HOME = /root
#10 1.001 ; Run `npm config ls -l` to show all defaults.
@jAg-upfort jAg-upfort added Bug thing that needs fixing Needs Triage needs review for next steps labels May 28, 2024
@jAg-upfort jAg-upfort changed the title [BUG] #7495 Partially fixes #7413, running workspaces scripts for workspaces in the / directoy is still broken. [BUG] #7495 Partially fixes #7413, but running workspaces scripts for workspaces in the / directoy is still broken. May 28, 2024
@jAg-upfort jAg-upfort changed the title [BUG] #7495 Partially fixes #7413, but running workspaces scripts for workspaces in the / directoy is still broken. [BUG] #7495 Partially fixes #7413, but running scripts for workspaces in the / directoy is still broken. May 28, 2024
@jacobdubailcadmv
Copy link

Same issue exists for me with the node:18-alpine and node:20-alpine releases.

@jAg-upfort
Copy link
Author

Hey, just wanted to ping on this bug and see about getting a timeline/triage for this bug

@oskarstucki
Copy link

Same issue with versions 18 and 20 still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

4 participants
@oskarstucki @jacobdubailcadmv @jAg-upfort and others