Closed atamike closed 1 year ago
I found out this is more problem with how the yarn audit works and how yarn.lock
is generated.
When you try to run yarn audit --verbose
on example you will get an error. The payload sent to audit looks like
verbose 0.379 Audit Request: {
"name": "example",
"version": "0.1.0",
"install": [],
"remove": [],
"metadata": {},
"requires": {
"@mui/styled-engine": "npm:@mui/styled-engine-sc@5.8.0",
"@mui/styled-engine-sc": "5.8.0"
},
"dependencies": {
"@mui/styled-engine": {
"version": "5.8.0",
"integrity": "sha512-46eRLWxjTF0d50Q1Q9tj96cgF41r7lesbXAy6kKocCdUfJ8rbIo36C4Ws8Pd7nfVsvaitTb7tmCbVQzDT3niJQ==",
"requires": {
"prop-types": "^15.8.1"
},
"dependencies": {},
"dev": false
},
"prop-types": {
"version": "15.8.1",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.13.1"
},
"dependencies": {},
"dev": false
},
"loose-envify": {
"version": "1.4.0",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
},
"dependencies": {},
"dev": false
},
"object-assign": {
"version": "4.1.1",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"requires": {},
"dependencies": {},
"dev": false
},
"react-is": {
"version": "16.13.1",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
"requires": {},
"dependencies": {},
"dev": false
},
"js-tokens": {
"version": "4.0.0",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"requires": {},
"dependencies": {},
"dev": false
}
},
"dev": false
}
So there is missing @mui/styled-engine-sc
at all which cause the yarn audit
to fail. There is already opened issue inside the yarn https://github.com/yarnpkg/yarn/issues/7015
The current workaround is to modify yarn.lock
manually and duplicate the resolution for both packages like this:
"@mui/styled-engine-sc@5.8.0":
version "5.8.0"
resolved "https://registry.yarnpkg.com/@mui/styled-engine-sc/-/styled-engine-sc-5.8.0.tgz#20bc536dce25739e38fcd2586f100e70fbf02065"
integrity sha512-46eRLWxjTF0d50Q1Q9tj96cgF41r7lesbXAy6kKocCdUfJ8rbIo36C4Ws8Pd7nfVsvaitTb7tmCbVQzDT3niJQ==
dependencies:
prop-types "^15.8.1"
"@mui/styled-engine@npm:@mui/styled-engine-sc@5.8.0":
version "5.8.0"
resolved "https://registry.yarnpkg.com/@mui/styled-engine-sc/-/styled-engine-sc-5.8.0.tgz#20bc536dce25739e38fcd2586f100e70fbf02065"
integrity sha512-46eRLWxjTF0d50Q1Q9tj96cgF41r7lesbXAy6kKocCdUfJ8rbIo36C4Ws8Pd7nfVsvaitTb7tmCbVQzDT3niJQ==
dependencies:
prop-types "^15.8.1"
Hi :wave:
Thank you for reporting this and providing details about the issue. As it is an issue in yarn and Dependency Check is not concerned as of now, and because an issue has been opened in yarn project, I am closing this issue. :slightly_smiling_face:
Describe the bug Dependency-check throw an unexpected error when you try to scan
package.json
andyarn.lock
with aliasVersion of dependency-check used The problem occurs using version 7.3.2
Log file
To Reproduce
Package.json
Yarn.lock
Run command
dependency-check --scan "./yarn.lock" --disableNodeJS --disableRetireJS --nodeAuditSkipDevDependencies
Expected behavior The alias dependency is skipped and don't make the dependency-check to fail
Additional context We cannot simply remove the alias for dependency, we need it.