Invalid dependency on non-existent [email protected]
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
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]
Same issue on @angular-devkit/[email protected]
dependency [email protected]
We are not able to build application
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]"
}
}
}
Update package-lock to use https://github.com/stylus/stylus/archive/refs/tags/0.64.0.tar.gz
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
Upstream vite issue :
- vitejs/vite/issues/20461
same on
"@angular-devkit/build-angular": {
"version": "0.901.15",
"requires": {
"stylus": "0.54.7",
"stylus-loader": "3.0.2",
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?
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.
Facing similar issue with our Angular 12 application. Our deployment is stuck. Is there a work around for this stylus dependency?
https://github.com/stylus/stylus/issues/2938 mentions workarounds it the top comment of the issue.
Same issue on @angular-devkit/[email protected]
Same issue on @angular-devkit/build-angular": "~0.803.29
same issue on @angular-devkit/build-angular": "^0.901.0
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"
}
...
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
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
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
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 😅
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