Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot build the project with node:v17.2 and yackage:v0.6.0 #19

Open
TheNorthMemory opened this issue Feb 27, 2022 · 0 comments
Open

cannot build the project with node:v17.2 and yackage:v0.6.0 #19

TheNorthMemory opened this issue Feb 27, 2022 · 0 comments

Comments

@TheNorthMemory
Copy link

env:

  • node -v v17.2.0
  • npm -v 8.1.4
  • node -p 'process.platform' darwin
  • node -p 'process.arch' x64

when using the cmd, /node_modules/.bin/yackage --app-dir $PWD build $PWD/out for packaging, it goes failed with the following prompt:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:120:11)
    at Object.basename (node:path:1309:5)
    at packageApp (/Users/iwt/downloader/node_modules/yackage/lib/main.js:184:49)
    at async packageCleanApp (/Users/iwt/downloader/node_modules/yackage/lib/main.js:227:12)
    at async Command.build (/Users//iwt/downloader/node_modules/yackage/bin/yackage.js:32:3) {
  code: 'ERR_INVALID_ARG_TYPE'
}

debuggging the problem, it should be the following line:

yackage/lib/main.js

Lines 183 to 184 in 98a753d

const srcYodePath = getYode(appDir).path
const yodePath = path.resolve(outputDir, path.basename(srcYodePath))

The getYode function was returned an [AsyncFunction: downloadYode], there wasn't the path property, and it's caused the path.resolve goes failed.

yackage/lib/util.js

Lines 5 to 12 in 98a753d

// Find out the fetch-yode module.
function getYode(appDir) {
try {
return require(path.join(appDir, 'node_modules', 'fetch-yode'))
} catch {
throw new Error('The "fetch-yode" module must be a dependency of the app')
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant