Error installing create-react-app, cb() never called

I was running the npx create-react-app my-app and ran into an error. My npm version is: 6.9.0 and I’m using Mac OS Mojave. The log is a bit longer, but is too large to be able to submit.

Here is the log as a doc since i’m having trouble uploading it:
2019-06-05T13_22_28_273Z-debug.log (37.6 KB)

I’m not sure why npm doesn’t print more information here. process.exit() was invoked on a path they hadn’t foreseen. You could help by trying the following. Change /usr/local/lib/node_modules/npm/lib/utils/error-handler.js as follows. Find the part that says:

    if (!cbCalled) {
      log.error('', 'cb() never called!')
      console.error('')
      log.error('', 'This is an error with npm itself. Please report this error at:')
      log.error('', '    <https://npm.community>')
      writeLogFile()
    }

which may start around line 56.
Change the ‘error’ to a ‘trace’:

    if (!cbCalled) {
      log.error('', 'cb() never called!')
      console.trace()
      log.error('', 'This is an error with npm itself. Please report this error at:')
      log.error('', '    <https://npm.community>')
      writeLogFile()
    }

and then rerun your command and share the output.

If you’ve installed node/npm the default way, you’d need to use ‘sudo’ to edit this file, as in

sudo vi /usr/local/lib/node_modules/npm/lib/utils/error-handler.js 

or use an editor of your choice.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.