Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/helpers/getPackageVersion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { createRequire } = require('node:module')
const { join } = require('node:path/posix')

const { readJSON } = require('fs-extra')

Expand Down Expand Up @@ -31,7 +32,7 @@ module.exports.getAngularVersion = getAngularVersion
const getAngularRuntimeVersion = async function (root) {
let packagePath
try {
const siteRequire = createRequire(root)
const siteRequire = createRequire(join(root, ':internal:'))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the previous version ended up not working when actually installed and resulted in MODULE_NOT_FOUND (that was not immediate apparent, because we swallow the error message)

packagePath = siteRequire.resolve('@netlify/angular-runtime/package.json')
} catch {
// module not found
Expand Down