OfficeDev / generator-office

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

Errors when creating new addin #793

Closed jozefizso closed 3 months ago

jozefizso commented 7 months ago

Prerequisites

Expected behavior

Creating new addin should work seamlessly.

Current behavior

This error happens when new project is created:


I'm all done. Running npm install for you to install the required dependencies. If this fails, try running the command yourself.

npm WARN config cache-min This option has been deprecated in favor of `--prefer-offline`.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/helper-module-transforms@^7.23.3.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in: /Users/izso/.npm/_logs/2023-11-26T14_47_05_244Z-debug-0.log

No change to package.json was detected. No package manager install will be executed.

Steps to Reproduce

Follow instructions at https://learn.microsoft.com/en-us/office/dev/add-ins/tutorials/powerpoint-tutorial?tabs=yeomangenerator

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

jozefizso commented 7 months ago

When installing packages using npm install it shows another set of errors:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@azure/msal-node@1.18.4',
npm WARN EBADENGINE   required: { node: '10 || 12 || 14 || 16 || 18' },
npm WARN EBADENGINE   current: { node: 'v20.10.0', npm: '10.2.3' }
npm WARN EBADENGINE }
npm WARN deprecated debuglog@1.0.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated readdir-scoped-modules@1.1.0: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated @azure/msal-node@1.18.4: A newer major version of this library is available. Please upgrade to the latest available version.
npm WARN deprecated @azure/msal-browser@2.38.3: A newer major version of this library is available. Please upgrade to the latest available version.

added 1360 packages, and audited 1361 packages in 2m

186 packages are looking for funding
  run `npm fund` for details

10 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
nivethan-dev commented 7 months ago

@jozefizso, I am not a maintainer, but I believe the error you are encountering is due to the use of Node v20, which likely requires a lower version. If you have NVM installed, you can switch to version 18 by running the command nvm use --lts=hydrogen, which should resolve the issue.

However, if you have opened this issue to prompt compatibility with v20, I hope the maintainers will do something about it.

millerds commented 7 months ago

Yes . . . this is a known issue with some package we depend on and node v20. We are working on getting a fix form our partners. Using a lower version of node is the work around for the time being.

jozefizso commented 7 months ago

Node 20 is current LTS available for 7 months already.

millerds commented 7 months ago

It has been available for 7 months, but was only recently made LTS. It is something we are going to support, it just taking time to get our down-level package dependencies to get current.

mblack-montag commented 7 months ago

Developing on Windows, this was painful. Per the author, I was using a Microsoft article for creating an Excel addin. In particular, using this command: npm install -g yo generator-office. I started with the LTS installer for windows which installed v20.10. Once, I received a similar error as the author, I came here and found this post. Per @millerds post above, I switched to node v19.8.0. Again, no go. Then went to 18.19.0. Again, no go. Then went to 17.9.1. Definitely, a no go. Switched back to v19.8.0 and read the unsupported engine required text for yeoman where it said either 18.17.0 or >= 20.5.0. Then went to 18.17.0 and success.

Long story short, use node v18.17.0

fhg-isi commented 7 months ago

I asked here

https://github.com/OfficeDev/office-js-docs-pr/issues/4304

to update the documentation at

https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator#create-the-add-in-project

to not list "Node.js (the latest LTS version" as a prerequesite. Furthermore, Linux does not seem to be supported and I did not see some hint about that in the readme.

millerds commented 3 months ago

Updated packages that have support for Node 20 should be released now.