RetireJS / retire.js

scanner detecting the use of JavaScript libraries with known vulnerabilities. Can also generate an SBOM of the libraries it finds.
https://retirejs.github.io/retire.js/
Other
3.66k stars 414 forks source link

Unable to build Chrome Extension #430

Closed kwkeefer closed 5 months ago

kwkeefer commented 5 months ago

Retire.js version: (retire --version): Tried with 5.0.0-beta.1 release as well as the master branch.

node version: (node --version): v21.7.3

Description: The build_chrome.sh script fails with the following error message:

Error: Can't walk dependency graph: Cannot find module '../../node/lib/deepscan.js' from '/Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/index.js'
    required by /Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/index.js
    at /Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/node_modules/resolve/lib/async.js:167:35
    at load (/Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/node_modules/resolve/lib/async.js:186:43)
    at onex (/Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/node_modules/resolve/lib/async.js:211:17)
    at /Users/username/Downloads/retire.js-5.0.0-beta.1/chrome/build/node_modules/resolve/lib/async.js:24:69
    at FSReqCallback.oncomplete (node:fs:203:21)

Received the same message when following the instructions for installing the Chrome browser extension (using the master branch). Also tried the 5.0.0-beta.1 release.

Confirmed that the 4.4.2 release was able to build successfully.

Expected behaviour: The build should complete without errors.

If this is a false positive or false negative: N/A

eoftedal commented 5 months ago

Ok. Thanks. Can you try running npm run build in the node folder first?

eoftedal commented 5 months ago

The generated file is also checked in, so I think it should work even if the build script fails

kwkeefer commented 5 months ago

Ok. Thanks. Can you try running npm run build in the node folder first?

Yes that fixed it

kwkeefer commented 5 months ago

The generated file is also checked in, so I think it should work even if the build script fails

Ah - I'll be honest I'm not familiar with how Chrome Extensions work. I was just following the instructions and ran into issues.

Appreciate the response.

eoftedal commented 5 months ago

I will fix the build script (hence the reopen). This is still a bug. Thanks for reporting!