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] 7.0.6 regression in npm run #2065

Closed
gjasny opened this issue Oct 28, 2020 · 4 comments
Closed

[BUG] 7.0.6 regression in npm run #2065

gjasny opened this issue Oct 28, 2020 · 4 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@gjasny
Copy link

gjasny commented Oct 28, 2020

Hello,

when I run the following testcase in the dockerfile with npm 7.0.6 it fails with:

npm ERR! Cannot read property 'once' of undefined

Running it with 7.0.5 works as expected.

Dockerfile:

FROM ubuntu:20.04

# silence debconf
ENV DEBIAN_FRONTEND=noninteractive

# update base packages
RUN apt-get update && apt-get upgrade -y

# install nodejs
WORKDIR /opt
RUN apt-get install -y tar wget xz-utils
RUN wget --no-check-certificate https://nodejs.org/download/release/latest-v12.x/node-v12.19.0-linux-x64.tar.xz \
    && tar -axvf node-v12.19.0-linux-x64.tar.xz
RUN ln -s /opt/node-v12.19.0-linux-x64/bin/* /usr/local/bin/

# upgrade npm
RUN npm install npm@7.0.6 -g # CVE-2020-15095 / GHSA-xgh6-85xh-479p
RUN npm --version

# run testcase
WORKDIR /testcase
ADD package.json .
RUN npm run testcase

package.json:

{
    "name": "testcase",
    "version": "1.0.0",
    "description": "dummy test case",
    "scripts": {
        "testcase": "/bin/true"
    }
}

Could you please take a look?

@gjasny gjasny added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 28, 2020
gjasny added a commit to gjasny/2065-npm-error-reproducer that referenced this issue Oct 28, 2020
@gjasny
Copy link
Author

gjasny commented Oct 28, 2020

For convenience I added both files into a repo: https://github.com/gjasny/2065-npm-error-reproducer

@billyjanitsch
Copy link

Duplicate of npm/run-script#13. 🙂

@nlf nlf removed the Needs Triage needs review for next steps label Oct 29, 2020
@nlf nlf self-assigned this Oct 29, 2020
@nlf
Copy link
Contributor

nlf commented Nov 2, 2020

i believe this should be fixed in 7.0.7, can you try to update with npm i npm@7 and see if it's resolved for you?

@billyjanitsch
Copy link

@nlf I can confirm that this issue is fixed. Thanks!

@ljharb ljharb closed this as completed Nov 5, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 19 milestone Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants