question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

  • I am running the latest version of Node and the tools
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

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.

  • Operating System: macOS 10.15.4
  • Node version: 12.18.2
  • Office version: 16.93(20071300)
  • Tool version: 1.5.5

Failure Logs

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

3reactions
TCourtneyOwencommented, Jul 22, 2020

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:

  • npm uninstall -g yo generator-office
  • npm install -g yo generator-office
  • run “yo office” again

I hope this fixes things for you.

Thanks,

Courtney

2reactions
TCourtneyOwencommented, Jul 22, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module Please verify that the package.json ...
I got a similar error and fixed it by deleting node_modules and package-lock.json files and then run "npm install" to install dependencies.
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed.
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package /module ......
Read more >
node:internal/modules/cjs/loader:936 throw err - You.com
cannot find internal module/cjs/loader:936 throw err, i have 2 folder backend and ... Please verify that the package.json has a valid "main" entry...
Read more >
How to resolve "Cannot find module" error in Node - Sabe.io
json file at the root of the project. The Solution. To fix the Cannot find module error, simply install the missing modules using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found