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.

Webserver stops soon after starting in new project on Mac

See original GitHub issue

I created a new Angular project with typescript using this generator for a Word Add-in. I’ve done some debugging, and I hope it helps us solve the problem. Or someone can help correct my assumptions about how everything is working together if I’m off track! 😉

I’m running a fresh install of Node 14.2.0 using NVM after uninstalling node to help me debug the issue. The problem is that shortly after starting the web server the web server dies and I can’t hit the default built app.

Ultimately I think the problem stems from a new dependency issue in webpack-dev-server that the community has been attempting to address and release the past few weeks. I got there as I was trying to understand an error where fsevents was throwing “Cannot find module ‘nan’” while running yo office. I had tried clearing node_modules and running npm install directly, as well as installing nan as a project dependency before finding those github Issues.

I’m going to fiddle with different node/dependency versions and see if I can get into a state where I can develop the Add-in but I wanted to bring it up if there is anyone else experiencing the same problem, or if anyone has any suggestions or workarounds.


$ npm run start:web --verbose output

$ npm run start:web --verbose                                                                                      2.7.1 Mon 18 🕑  5:33:18
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/Users/hedges/.nvm/versions/node/v14.2.0/bin/node',
npm verb cli   '/Users/hedges/.nvm/versions/node/v14.2.0/bin/npm',
npm verb cli   'run',
npm verb cli   'start:web',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@6.14.4
npm info using node@v14.2.0
npm verb run-script [ 'prestart:web', 'start:web', 'poststart:web' ]
npm info lifecycle office-addin-taskpane-angular@0.0.1~prestart:web: office-addin-taskpane-angular@0.0.1
npm info lifecycle office-addin-taskpane-angular@0.0.1~start:web: office-addin-taskpane-angular@0.0.1

> office-addin-taskpane-angular@0.0.1 start:web /Users/hedges/projects/test/testing-angular-ts
> office-addin-debugging start manifest.xml web

Debugging is being started...
App type: web
Starting the dev server... (webpack-dev-server --mode development)
The dev server is running on port 3000. Process id: 17047
Debugging started.
npm verb lifecycle office-addin-taskpane-angular@0.0.1~start:web: unsafe-perm in lifecycle true
npm verb lifecycle office-addin-taskpane-angular@0.0.1~start:web: PATH: /Users/hedges/.nvm/versions/node/v14.2.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/hedges/projects/test/testing-angular-ts/node_modules/.bin:/Users/hedges/.rbenv/shims:/Users/hedges/.nvm/versions/node/v14.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/hedges/projects/flutter/bin
npm verb lifecycle office-addin-taskpane-angular@0.0.1~start:web: CWD: /Users/hedges/projects/test/testing-angular-ts
npm info lifecycle office-addin-taskpane-angular@0.0.1~poststart:web: office-addin-taskpane-angular@0.0.1
npm verb exit [ 0, true ]
npm timing npm Completed in 17756ms
npm info ok 

Key $ yo office output

> fsevents@1.2.12 install /Users/hedges/projects/test/testing-angular-ts/node_modules/watchpack/node_modules/fsevents
> node-gyp rebuild

internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module 'nan'
Require stack:
- /Users/hedges/projects/test/testing-angular-ts/node_modules/watchpack/node_modules/fsevents/[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at [eval]:1:1
    at Script.runInThisContext (vm.js:131:20)
    at Object.runInThisContext (vm.js:297:38)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at evalScript (internal/process/execution.js:94:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/hedges/projects/test/testing-angular-ts/node_modules/watchpack/node_modules/fsevents/[eval]'
  ]
}
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/hedges/.nvm/versions/node/v14.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/Users/hedges/.nvm/versions/node/v14.2.0/bin/node" "/Users/hedges/.nvm/versions/node/v14.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hedges/projects/test/testing-angular-ts/node_modules/watchpack/node_modules/fsevents
gyp ERR! node -v v14.2.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
TCourtneyOwencommented, May 19, 2020

@RyanHedges Thanks for reporting this issue. I will if I can repro this as well on Mac using the latest version of NodeJs. I will keep you posted.

-Courtney

0reactions
RyanHedgescommented, May 20, 2020

Thanks for the help! I’m going to close this issue since the exceptions thrown don’t seem to cause the seen issue. If I can help with anything, please let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Safari on Mac doesn't open a webpage or isn't working as ...
If that works, use the following steps to remove the website's data, including its caches and cookies. The website can then create new...
Read more >
XAMPP Apache Webserver localhost not working on MAC OS
This is what helped me: sudo apachectl stop. This command killed Apache server that was pre-installed on MAC OS X.
Read more >
How to Fix the Apache Server Not Starting in MAMP Error (In 4 ...
Causes of the Apache Server Not Starting in MAMP Error · Step 1: Ensure That Skype Is Not Running · Step 2: Make...
Read more >
Mac Apps Not Opening or Slow Due to Apple Server Issues
If you are seeing long delays in launching apps or being unable to open Mac Apps at all, this may be due to...
Read more >
Stopping and Restarting Apache HTTP Server
In order to stop or restart the Apache HTTP Server, you must send a signal to the ... of the configuration, which begins...
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