ember.jsember-cli

Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'


I've recently updated ember-cli and my app to 4.10.0, and trying to build with:

ember serve

throws the following error:

Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'

I've looked to see what module is missing. I came up with trying to install/reinstall ember-cli-babel and that didn't work either.

The ember app is on LAMP: Raspbian Linux 11 OS, Apache 2.4.54, MariaDB 10.5.15, and PHP/Laravel 8 backend

ember-cli: 4.10.0

ember-source: 4.10.0

ember-cli-babel: 7.26.11

I don't have any special ember-cli-build configurations, here it is:

'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
     const app = new EmberApp(defaults, {

     });

     return app.toTree();
}

EDIT: ERROR STACK

  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'
Require stack:
- /var/www/html/.../node_modules/@ember-data/private-build-infra/src/debug-macros.js
- /var/www/html/.../node_modules/@ember-data/private-build-infra/src/stripped-build-plugins.js
- /var/www/html/.../node_modules/@ember-data/private-build-infra/src/addon-build-config-for-data-package.js
- /var/www/html/.../node_modules/ember-data/index.js
- /var/www/html/.../node_modules/ember-cli/lib/models/package-info-cache/package-info.js
- /var/www/html/.../node_modules/ember-cli/lib/models/package-info-cache/index.js
- /var/www/html/.../node_modules/ember-cli/lib/models/project.js
- /var/www/html/.../node_modules/ember-cli/lib/utilities/get-config.js
- /var/www/html/.../node_modules/ember-cli/lib/utilities/instrumentation.js
- /var/www/html/.../node_modules/ember-cli/lib/cli/index.js
- /usr/local/lib/node_modules/ember-cli/bin/ember

    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)
    at debugMacros (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/debug-macros.js:6:44)
    at module.exports (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/stripped-build-plugins.js:11:48)
    at Class.buildBabelOptions (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/addon-build-config-for-data-package.js:149:62)
    at Class._setupBabelOptions (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/addon-build-config-for-data-package.js:168:33)
    at Class.included (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/addon-build-config-for-data-package.js:184:12)
    at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
    at /var/www/html/.../node_modules/ember-cli/lib/models/addon.js:497:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (/var/www/html/.../node_modules/ember-cli/lib/models/addon.js:494:24)
    at Class.included (/var/www/html/.../node_modules/ember-cli/lib/models/addon.js:769:10)
    at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
    at Class.included (/var/www/html/.../node_modules/@ember-data/private-build-infra/src/addon-build-config-for-data-package.js:174:28)
    at Class.superWrapper [as included] (/var/www/html/.../node_modules/core-object/lib/assign-properties.js:34:20)
    at /var/www/html/.../node_modules/ember-cli/lib/broccoli/ember-app.js:721:15

Solution

  • After days of googling and trying a variety of things, I was able to get my ember application to launch again. Here is what worked for me, for whatever reason.

    I removed all the files inside my projects node_modules directory

    sudo rm -r node_modules/*
    

    and reinstalled all those packages with

    npm install
    

    After this, and I'm not sure if this really had anything to do with the resolution, I updated npm from 9.4.1 to 9.4.2

    npm install -g npm@9.4.2
    

    Once all of those commands executed successfully, I ran

    ember serve
    

    and I no longer received the above error.

    I hadn't thought I ever used sudo to install any npm packages, at least I try to make it a habit not to. But, it's possible I screwed up during my many butchered attempts at updating my ember app from 4.9 to 4.10.