OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

Yo office doesn't work after updating yo #3855

Open boramuyar opened 9 months ago

boramuyar commented 9 months ago

Your Environment

Expected behavior

I have been playing around with setting up office.js with vite instead of yo office. I have updated yeomen generator to the latest version, it no longer supports "yo office".

Current behavior

I am getting this error:

> yo office
Error office 
Current environment doesn't provides some necessary feature this generator needs.

Steps to reproduce

  1. Update yo to 5.0.0
  2. Run "yo office"
jkpieterse commented 9 months ago

I have the same issue, updated and now cannot use yo office. This is what yo doctor reports: Yeoman Doctor Running sanity checks on your system

√ No .bowerrc file in home directory √ Global configuration file is valid √ NODE_PATH matches the npm root √ No .yo-rc.json file in home directory √ Node.js version √ yo version √ npm version

Help?

jkpieterse commented 9 months ago

I was able to fix this issue by running this command: "npm install -g yo generator-office" But now yo office generates a whole bunch of errors:


  Creating myAddin add-in for Excel using TypeScript and Taskpane at C:\Users\userName\Documents\office-js-add-ins\myAddin\myAddin

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

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: office-addin-taskpane@0.0.1 npm ERR! Found: webpack@undefined npm ERR! node_modules/webpack npm ERR! dev webpack@"^5.76.3" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer webpack@">=2" from babel-loader@8.3.0 npm ERR! node_modules/babel-loader npm ERR! dev babel-loader@"^8.2.2" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\piete\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\piete\AppData\Local\npm-cache_logs\2023-11-27T15_07_15_216Z-debug-0.log

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

I have no idea what to do next!

rl17 commented 1 month ago

I ran into the same issue, guessing from the failure messages "npm ERR! code ERESOLVE …" mentioned above.

I could solve it in my case by running "sudo yo office" instead of just "yo office".