OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
825 stars 208 forks source link

yo office command throws an error on macOS Monterey #681

Closed gandarez closed 2 years ago

gandarez commented 2 years ago

Current behavior

Running yo office .... returns an error. It used to work before.

/usr/local/lib/node_modules/yo/node_modules/macos-release/index.js:26
    const [name, version] = nameMap.get(release);
                                    ^

TypeError: nameMap.get is not a function or its return value is not iterable
    at macosRelease (/usr/local/lib/node_modules/yo/node_modules/macos-release/index.js:26:34)
    at osName (/usr/local/lib/node_modules/yo/node_modules/os-name/index.js:21:18)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:37:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:54:17)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)

Steps to Reproduce

yo office --projectType angular --name "MyAddin" --host excel --ts true

Context

millerds commented 2 years ago

The call stack seems to indicate a problem with yeoman generator on mac (the module seems to be for ethe mac os). You might try upgrading your version of yeoman generator using 'npm install yo@latest -g' (and maybe do the same for generator-office).

gandarez commented 2 years ago

I had wipe yo and manually delete some folders. After re-installed it got working again.