OfficeDev / generator-office

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

Outlook task pane project generates project.zip and fails #740

Closed brandpeter closed 1 year ago

brandpeter commented 1 year ago

STR: In CMD type yo office ? Choose a project type: Office Add-in Task Pane project ? Choose a script type: (Use arrow keys) ? Choose a script type: JavaScript ? What do you want to name your add-in? Outtask ? Which Office client application would you like to support? Outlook


  Creating Outtask add-in for Outlook using JavaScript and Taskpane at C:\inetpub\wwwroot\Outtask

After a while command prompt appears, and the only file in the folder is project.zip, which cannot be opened as it is invalid zip. No idea why it asks for the script type twice. Microsoft Windows [Version 10.0.19043.2130] npm@8.19.2 Yeoman downloaded and installed today. Generated an Excel Task pane project just fine, deleted that, now it no longer works. Tried re-installing npm install -g yo generator-office, no change.

millerds commented 1 year ago

What version of node are you using?

Also . . . any reason you are doing this in C:\inetpub\wwwroot\ ? I'm wondering if there are special permissions on this folder that are not playing well with yeoman generator. As part of the process for generating the project we download the zip file from github and then try to unzip it. It's conceivable that there are permissions interfering with this. Can you try it in another folder (like your desktop or something)?

brandpeter commented 1 year ago

IIS uses that folder for localhost web server, which is where I thought the code should be for testing. You are quite right, Yeoman runs successfully in another folder where I am the owner. Incidentally, that "Choose a script type" needs to be responded to twice. Node version I downloaded recently 18.20.0 LTS Windows 64. Thanks Darren.

millerds commented 1 year ago

I'm not sure about the double question. I have not tried this on node 18, but I'm not sure why that would make a difference.

The projects generated haven't been testing on node 18, so you'd have to modify the generated package.json file to remove that restriction and take your chances. Other than that, the project generated should be able to run on local host without being in a specific folder.

millerds commented 1 year ago

Updated node support