OfficeDev / generator-office

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

Error office Cannot find module '.../v12.18.2/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js'. Please verify that the package.json has a valid "main" entry #547

Closed elmeet closed 4 years ago

elmeet commented 4 years ago

Prerequisites

> npm install -g yo generator-office
> yo office
Error office
Cannot find module '/Users/xxx/.nvm/versions/node/v12.18.2/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js'. Please verify that the package.json has a valid "main" entry

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Expected behavior

Expect normal execution and template generation

Current behavior

Failed to execute yo office

> yo office
Error office
Cannot find module '/Users/xxx/.nvm/versions/node/v12.18.2/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js'. Please verify that the package.json has a valid "main" entry

Steps to Reproduce

  1. npm install -g yo generator-office
  2. yo office

Context

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

Failure Logs

saschwarz commented 4 years ago

I'm getting the same error with a freshly install node v12.16.3

> yodoctor

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
✔ npm version
✔ yo version

Everything looks all right!
+ generator-office@1.7.1
+ yo@3.1.1
added 1195 packages from 454 contributors in 21.309s

> yo
? 'Allo Steve! What would you like to do? Office

Make sure you are in the directory you want to scaffold into.
This generator can also be run with: yo office

Error  

Cannot find module '/Users/saschwarz/.nvm/versions/node/v12.16.3/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js'. Please verify that the package.json has a valid "main" entry

The referenced file does not exist nor does it's parent lib directory:

/tmp/foo ➜ ls /Users/saschwarz/.nvm/versions/node/v12.16.3/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js
ls: /Users/saschwarz/.nvm/versions/node/v12.16.3/lib/node_modules/generator-office/node_modules/office-addin-manifest/lib/main.js: No such file or directory

/tmp/foo ➜ ls /Users/saschwarz/.nvm/versions/node/v12.16.3/lib/node_modules/generator-office/node_modules/office-addin-manifest/           
LICENSE      README.md    cli.js       node_modules package.json
AGDholo commented 4 years ago

Same error on

Cannot find module 'C:\Users\agdho\AppData\Roaming\npm\node_modules\generator-office\node_modules\office-addin-manifest\lib\main.js'. Please verify that the package.json has a valid "main" entry
TCourtneyOwen commented 4 years ago

Thanks for reporting this issue. I will look into this today and get back to you.

-Courtney

rpfeuti commented 4 years ago

Same problem here, windows 10, tried on Node.js 12.18.2 LTS and 14.6.0 yo office --projectType react --name "Testing" --host excel --ts true

TCourtneyOwen commented 4 years ago

I think it must be an issue with the new version of office-addin-manifest that was published yesterday. I noticed in the latest version there is no tsconfig contained in the package, so this would cause build of the lib file to fail. I suspect this was a problem with the NPM publishing process. I will get a new version of the package published today

saschwarz commented 4 years ago

@TCourtneyOwen FWIW I manually linked an old version office-addin-manifest in the installed generator-office package in node_modules and was able to progress further. Then I got the same error on office-addin-usage-data.

FabianValenciaR commented 4 years ago

Same problem here.

Windows Version: 10.0.18363 Build 18363 Node Version: 12.18.2 yo version: 3.1.1

Error office Cannot find module 'C:\Users\xxx\AppData\Roaming\npm\node_modules\generator-office\node_modules\office-addin-manifest\lib\main.js'. Please verify that the package.json has a valid "main" entry.

TCourtneyOwen commented 4 years ago

@saschwarz Yes something seems to have happened during lerna publish to NPM yesterday. While there were no errors thrown, the publish process seems to have failed in some way

TCourtneyOwen commented 4 years ago

OK, I republished all the packages I published yesterday (including office-addin-manifest) without making any changes, but the versions will be bumped up one. Yo office is now working for me locally on three different machines.

Can you all please try the following:

I hope this fixes things for you.

Thanks,

Courtney

saschwarz commented 4 years ago

I just pulled down generator-office@1.7.1 again and with office-addin-manifest@1.5.6 it works now. Thanks for resolving this so quickly!!

TCourtneyOwen commented 4 years ago

Awesome, glad to hear it! As far as I can tell, there just must have been some publishing hiccup to NPM yesterday that didn't return any sort of error. I merely republished and this time it appears to have worked as expected

rpfeuti commented 4 years ago

Is working. Thank you guys for so fast response. Best regards

Alex-Willenbrink commented 4 years ago

YES! THANKS FOR THE FIX

TCourtneyOwen commented 4 years ago

Seems like everyone is good to now. I am closing this issue.