【发布时间】:2021-06-06 10:40:07
【问题描述】:
对于在我的团队资料生成器中选择的每个角色,我不断收到以下错误消息:
(node:21484) UnhandledPromiseRejectionWarning: TypeError: manager.push is not a function
在 C:\Users\User\OneDrive\Desktop\Team Profile Generator\GOTEAMGO\index.js:48:29
在 processTicksAndRejections (internal/process/task_queues.js:93:5)
then(({ fullname, id, email, role }) => {
if (role === "Manager") {
let manager = "";
return inquirer
.prompt([{
type: 'text',
name: 'office',
message: " What is the Office Number?"
}])
.then(({ office }) => {
manager.push(new Manager(fullname, id, email, office))
teammates.push(manager);
cardhtml(teammates)
html();
})
【问题讨论】:
标签: node.js