NPM and Composer issues, with solutions

Hi Everyone. Today I had a heck of a time dealing with NPM and Composer issues. I have several different directories in my git_repo directory and I couldn’t figure out why running “npm run build” was working for one project and not for the other.

Here are some of the issues I ran into:
[19:17:37] The following tasks did not complete: default, , styles_style_color, styles_style_color_compact, styles_style_uni, styles_style_uni_compact, styles_style_portal, styles_style_tabs, styles_style_misc, rtl_style_color, rtl_style_color_compact, rtl_style_uni, rtl_style_uni_compact, rtl_style_portal, rtl_style_tabs, rtl_style_misc
[19:17:37] Did you forget to signal async completion?

The other issue I ran into was sometimes getting an error about Primodals:

ReferenceError: primordials is not defined

Well, after running around in circles I found a way to fix this.

  1. removed the vendor directory (this gets reinstalled when ‘composer install’ is ran)
  2. removed the node_modules directory (this gets installed when ‘npm install’ is ran)
  3. removed the public/assets directory
  4. pull from master the small contents of the public/assets directory from upstream/master
  5. composer install (get back a fresh vendor folder)
  6. npm install
  7. npm run update
    8)composer dump-autoload -o

and I stopped getting the errors. I pulled my hair out for three hours. I guess there were some files in the assets folder that were not getting updated and it was causing a bunch of errors. I’m imagine I will run into the same issue again so I’m posting for my sake and the sake of others!!

Update

ReferenceError: primordials is not defined

One solution I found was making sure that I am using the most current version of npm. In one of my projects I had npm running fine until I decided to run an audit fix. It changed my version from npm 4 to an older 3.x version. Once I updated the npm back to 4.x it started working again.