Meteor 3 add-platform android breaks meteor installation on windows 11

Hello everyone,

I’ve encountered a problem when attempting to add the Android platform to a Meteor project on a Windows 11 system. This is a fresh Meteor 3.0.1 installation by the way. Here are the details of the issue:

  1. When running the command meteor add-platform android, the following error occurs:
Error: Error: couldn't install npm package cordova-common@4.0.2: Command failed: C:\Windows\system32\cmd.exe /c C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\dev_bundle\bin\npm.cmd install cordova-common@4.0.2
node:internal/modules/cjs/loader:1148
  throw err;
  ^

Error: Cannot find module 'C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\npm\bin\npm-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.15.1

  1. After this error, attempting to run any meteor command results in the following error:
node:internal/modules/cjs/loader:1148
  throw err;
  ^

Error: Cannot find module '@meteorjs/reify/lib/runtime'
Require stack:
- C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\static-assets\server\runtime.js
- C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\tool-env\install-reify.js
- C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\tool-env\install-babel.js
- C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at enable (C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\static-assets\server\runtime.js:34:5)
    at Object.<anonymous> (C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\tool-env\install-reify.js:12:48)
    at Object.<anonymous> (C:\Users\rrd\AppData\Local\.meteor\packages\meteor-tool\3.0.1\mt-os.windows.x86_64\tools\tool-env\install-reify.js:15:3)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\rrd\\AppData\\Local\\.meteor\\packages\\meteor-tool\\3.0.1\\mt-os.windows.x86_64\\tools\\static-assets\\server\\runtime.js',
    'C:\\Users\\rrd\\AppData\\Local\\.meteor\\packages\\meteor-tool\\3.0.1\\mt-os.windows.x86_64\\tools\\tool-env\\install-reify.js',
    'C:\\Users\\rrd\\AppData\\Local\\.meteor\\packages\\meteor-tool\\3.0.1\\mt-os.windows.x86_64\\tools\\tool-env\\install-babel.js',
    'C:\\Users\\rrd\\AppData\\Local\\.meteor\\packages\\meteor-tool\\3.0.1\\mt-os.windows.x86_64\\tools\\index.js'
  ]
}

Node.js v20.15.1

To resolve this issue temporarily, I have to reinstall Meteor (delete the whole .meteor folder).

Has anyone else experienced this issue?

This is a reproducible issue on my Windows env as well. We take a note to cover it on next patches.

Thank you for the report.

For get you unblocked, have you ever tried to use Meteor using WSL in Windows? It matches a UNIX environment where is working, and maybe could be a good movement in general to improve speed experience as well.

does meteor@2.7.4 has this kind of error ?

This issue seems specific to Meteor 3 on Windows, but it might affect the Meteor tool itself.

If you download the latest Meteor 3 tool using npx meteor@latest on a Windows machine, it could impact any project managed with it, even Meteor 2 ones. This is just a guess, though, and not confirmed. Have you encountered the same error while using Meteor 2?

If you run into this problem, try removing your current Meteor installation and use npx meteor@2.16.0. I believe it shouldn’t happen with that version assuming you get the problem.

can i walk you through what i did so far? i should mention that node js version i use is v20.17.0

  1. npm install -g meteor --foreground-script
  2. meteor create myapp
  3. cd myapp
    4.meteor

so far the web app works fine
when i try to use (meteor add-platform android) the error (missing modules) arises and after that no meteor command works

Yes, as mentioned in this forum post, that is the issue identified, and I am currently working on a fix for the next release, 3.0.4.

This PR will involve a complete review of Cordova on Windows, as additional issues have emerged. WSL functions well, but raw Windows has introduced problems in newer versions.

To resolve this issue and continue working on your Meteor project after meteor add-platform android, please reinstall Meteor (npx meteor uninstall then npx meteor). Note that you cannot work with Cordova projects using raw Windows until the next version is released. If needed, please use WSL or a UNIX-like system. I will provide updates here once we address these issues.

Thank you for all your reports on this matter

1 Like

There has been a full review on Meteor Cordova when working in Windows environments. The Meteor Cordova has been fully reviewed for Windows environments. The issue mentioned, along with others found during testing, has been resolved. Documentation for Cordova on Windows has also been updated.

Release 3.0.4 is now available. Run meteor update --release 3.0.4 to start using it. Please consider reinstalling Meteor completely, as these changes involve dev_bundle modifications that may only be effective on clean installations. (npx meteor@latest uninstall and then npx meteor).

Related PRs

1 Like