angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Invalid dependency on non-existent [email protected]

Open jnsbhesaniya98 opened this issue 1 year ago • 21 comments

Command

add

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When installing dependencies using npm install, the following error is encountered:

npm ERR! 404 Not Found - GET https://registry.npmjs.org/stylus/-/stylus-0.56.0.tgz - Not found npm error code ETARGET npm error notarget No matching version found for [email protected]. npm error notarget In most cases you or one of your dependencies are requesting npm error notarget a package version that doesn't exist. npm notice

Minimal Reproduction

Step 1 : Create a new Angular project using version 13.3.9 Step 2 : npm install Observe the error:

Exception or Error


Your Environment

13.3.11

Anything else relevant?

No response

jnsbhesaniya98 avatar Jul 23 '25 06:07 jnsbhesaniya98

The affects projects with @angular/[email protected] as stylus has been removed by NPM.

See https://github.com/stylus/stylus/issues/2938

For those wondering how it is used by Angular:

npm ls stylus
     ├─┬ @angular/[email protected]
     │ └─┬ [email protected]
     │   └── [email protected]

Exac avatar Jul 23 '25 06:07 Exac

Same issue on @angular-devkit/[email protected]

dependency [email protected]

We are not able to build application

Risatronex avatar Jul 23 '25 07:07 Risatronex

If you don't use stylus: here is a temp fix for pnpm but should also work for all other package managers

package.json

{
...
"pnpm": {
    "overrides": {
      "stylus": "npm:[email protected]"
    }
  }
}

MitkoTschimev avatar Jul 23 '25 08:07 MitkoTschimev

Update package-lock to use https://github.com/stylus/stylus/archive/refs/tags/0.64.0.tar.gz

uyennguyendinhtuong avatar Jul 23 '25 08:07 uyennguyendinhtuong

I don't suggest it until it's clear that the stylus doesn't have malware.

https://github.com/advisories/GHSA-fh4q-jc76-r59p https://github.com/stylus/stylus/issues/2938

MitkoTschimev avatar Jul 23 '25 08:07 MitkoTschimev

Upstream vite issue :

  • vitejs/vite/issues/20461

JeanMeche avatar Jul 23 '25 08:07 JeanMeche

same on

"@angular-devkit/build-angular": {
"version": "0.901.15",
"requires": {
        "stylus": "0.54.7",
        "stylus-loader": "3.0.2",

jonny64 avatar Jul 23 '25 08:07 jonny64

npm error code ETARGET npm error notarget No matching version found for [email protected]. npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.

I got this error just today in the pipeline.

I tried to recreate it by removing package lock and node modules and since then it is not working at alll for me.

We have a UAT deployment today, is there any fix present for this?

sidnegi2511 avatar Jul 23 '25 09:07 sidnegi2511

Devs who are using Angular Version < 15 with scss (sass) instead of css, try below

npm cache clean --force

rm -rf node_modules

rm package-lock.json

npm install

I don't know how, but it worked for me. pipelines are working now...

Once urgent release live, do not forget to remove the stylus from the npm packages... until we get proper clarification from NPM.

justjcool avatar Jul 23 '25 10:07 justjcool

Facing similar issue with our Angular 12 application. Our deployment is stuck. Is there a work around for this stylus dependency?

nitishSa avatar Jul 23 '25 10:07 nitishSa

https://github.com/stylus/stylus/issues/2938 mentions workarounds it the top comment of the issue.

JeanMeche avatar Jul 23 '25 10:07 JeanMeche

Same issue on @angular-devkit/[email protected]

saraefaf avatar Jul 23 '25 13:07 saraefaf

Same issue on @angular-devkit/build-angular": "~0.803.29

KilianBoute avatar Jul 23 '25 13:07 KilianBoute

same issue on @angular-devkit/build-angular": "^0.901.0

monis8khan avatar Jul 23 '25 13:07 monis8khan

If you don't use stylus: here is a temp fix for pnpm but should also work for all other package managers

package.json

{
...
"pnpm": {
    "overrides": {
      "stylus": "npm:[email protected]"
    }
  }
}

this temporary fix for npm, if someone looks for:

  ...
  "overrides": {
    "stylus": "0.0.1-security"
  }
  ...

TheLamed avatar Jul 23 '25 14:07 TheLamed

If you don't use stylus: here is a temp fix for pnpm but should also work for all other package managers

package.json

{
...
"pnpm": {
    "overrides": {
      "stylus": "npm:[email protected]"
    }
  }
}

I am using npm, seems like this is not working for me, it still trying to get 0.59 version

menukaNaya avatar Jul 23 '25 14:07 menukaNaya

If you don't use stylus: here is a temp fix for pnpm but should also work for all other package managers package.json

{
...
"pnpm": {
    "overrides": {
      "stylus": "npm:[email protected]"
    }
  }
}

this temporary fix for npm, if someone looks for:

  ...
  "overrides": {
    "stylus": "0.0.1-security"
  }
  ...

🤔 Using npm here, added

"overrides": { "stylus": "0.0.1-security" }

Still not working for me

menukaNaya avatar Jul 23 '25 14:07 menukaNaya

If you don't use stylus: here is a temp fix for pnpm but should also work for all other package managers package.json

{
...
"pnpm": {
    "overrides": {
      "stylus": "npm:[email protected]"
    }
  }
}

this temporary fix for npm, if someone looks for:

  ...
  "overrides": {
    "stylus": "0.0.1-security"
  }
  ...

🤔 Using npm here, added

"overrides": { "stylus": "0.0.1-security" }

Still not working for me

It works fine, try to perform these steps before npm install

npm cache clean --force

rm -rf node_modules

rm package-lock.json

npm install

KhushalGupta avatar Jul 23 '25 15:07 KhushalGupta

stylus/stylus#2938 mentions workarounds it the top comment of the issue.

this workarround works here deleting the yarn.lock, but it breaks the build on Iodash 😅

LeaoSomogyi avatar Jul 23 '25 15:07 LeaoSomogyi

To reiterate, the root cause is the stylus package being taken down from NPM due to a security issue. Because this is not a package we directly depend on, we cannot implement a fix.

You can find workarounds and track the problem here: https://github.com/stylus/stylus/issues/2938

alan-agius4 avatar Jul 23 '25 15:07 alan-agius4