Meteor fails to create and run app on Windows

Well, the title should be “Meteor fails to do anything on Windows”.
I don’t know if this is a meteor issue or an issue with our corporate machine setup.

I’ve tried numerous attempts at getting meteor setup on two different Windows machines.

First of all, I’m using nvm-windows and currently:

node -v: 14.19.2
npm -v: 6.14.17

and doing npm install -g meteor fails invariably with the following error:

C:\tools\nvm\symlink\meteor-installer -> C:\tools\nvm\symlink\node_modules\meteor\cli.js

> meteor@2.8.0 install C:\tools\nvm\symlink\node_modules\meteor
> node cli.js install

=> Meteor Downloaded in 0.226s
Decompressing |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░| 0%events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: C:\Users\npschoo\AppData\Local\Temp\tmp-22272-xbMV3JEeHmHt\meteor.tar.gz
    at Object.fromBuffer (C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\node-7z\src\error.js:30:15)
    at C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\node-7z\src\events.js:25:19
    at Socket.<anonymous> (C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\node-7z\src\lifecycle.js:64:51)
    at Socket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at Socket.Readable.push (internal/streams/readable.js:206:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
Emitted 'error' event on Readable instance at:
    at C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\node-7z\src\events.js:90:12
    at ChildProcess.<anonymous> (C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\node-7z\src\lifecycle.js:66:42)
    at ChildProcess.emit (events.js:400:28)
    at ChildProcess.cp.emit (C:\tools\nvm\v14.19.2\node_modules\meteor\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:1088:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5) {
  stderr: 'ERROR: C:\\Users\\npschoo\\AppData\\Local\\Temp\\tmp-22272-xbMV3JEeHmHt\\meteor.tar.gz\r\n' +
    'C:\\Users\\npschoo\\AppData\\Local\\Temp\\tmp-22272-xbMV3JEeHmHt\\meteor.tar.gz\r\n' +
    'Open ERROR: Cannot open the file as [gzip] archive\r\n' +
    '\r\n' +
    '\r\n' +
    'ERRORS:\r\n' +
    'Is not archive\r\n',
  level: 'ERROR'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor@2.8.0 install: `node cli.js install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor@2.8.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\npschoo\AppData\Roaming\npm-cache\_logs\2022-10-26T21_43_19_983Z-debug.log

I’ve tried different versions of node. I’ve tried different versions of meteor. Always get this error. I have manually gone and checked C:\Users\npschoo\AppData\Local\Temp\tmp-22272-xbMV3JEeHmHt\meteor.tar.gz and tried to extract it with 7zip. It fails with the same error shown: is not an archive.
So, the meteor installer is downloading a bad gzip?


So, I’ve gone ahead and done the alternative install method found here:

The meteor command works with the following output:

run: You're not in a Meteor project directory.

To create a new Meteor project:
  meteor create <project name>
For example:
  meteor create myapp

For more help, see 'meteor --help'.

but doing meteor create myapp yields:

C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:218
      throw error;
      ^

Error: incorrect header check
    at Zlib.zlibOnError [as onerror] (zlib.js:187:17)
 => awaited here:
    at Promise.await (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:60:12)
    at Object.extractTarGz (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\tools\fs\tools\fs\files.ts:791:11)
    at Object.exports._extractAndConvert (C:\tools\packaging\tropohouse.js:47:9)
    at C:\tools\packaging\tropohouse.js:502:42
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at C:\tools\packaging\tropohouse.js:499:24
    at Function.each (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\underscore\underscore-node-f-pre.js:1316:7)
    at C:\tools\packaging\tropohouse.js:466:11
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at Object.download (C:\tools\packaging\tropohouse.js:424:20)
    at C:\tools\packaging\tropohouse.js:610:18
    at C:\tools\utils\buildmessage.js:609:21
    at C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
 => awaited here:
    at Promise.await (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:60:12)
    at Object.forkJoin (C:\tools\utils\buildmessage.js:641:6)
    at exports.Tropohouse.downloadPackagesMissingFromMap (C:\tools\packaging\tropohouse.js:606:18)
    at C:\tools\project-context.js:921:25
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at C:\tools\project-context.js:920:20
    at C:\tools\packaging\catalog\catalog.js:100:5
    at Object.capture (C:\tools\utils\buildmessage.js:283:5)
    at Object.catalog.runAndRetryWithRefreshIfHelpful (C:\tools\packaging\catalog\catalog.js:99:31)
    at ProjectContext._downloadMissingPackages (C:\tools\project-context.js:919:13)
    at C:\tools\project-context.js:365:9
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at ProjectContext._completeStagesThrough (C:\tools\project-context.js:355:18)
    at C:\tools\project-context.js:347:12
    at Function.run (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\tools\tool-env\tools\tool-env\profile.ts:289:14)
    at ProjectContext.prepareProjectForBuild (C:\tools\project-context.js:346:13)
    at C:\tools\cli\commands.js:840:20
    at Object.capture (C:\tools\utils\buildmessage.js:283:5)
    at Object.main.captureAndExit (C:\tools\cli\main.js:281:29)
    at Command.func (C:\tools\cli\commands.js:814:8)
    at C:\tools\cli\main.js:1534:15 {
  errno: -3,
  code: 'Z_DATA_ERROR'
}

I thought this could be an issue with permissions in the AppData\Local folder, so I moved my meteor installation to D:\tools\.meteor. Same error (the output above is actually from after the move).
The alternate instructions above say that meteor must be installed in ‘%LocalAppData%.meteor’, but it’s unclear to me whether that’s true or if meteor just has to be in a directory named .meteor.

After running meteor create myapp, there are still files created despite the error:

myapp
│   .gitignore
│   package.json
├───.meteor
│   │   .finished-upgraders
│   │   .gitignore
│   │   .id
│   │   packages
│   │   platforms
│   │   release
│   └───local
│           resolver-result-cache.json
├───client
│       main.css
│       main.html
│       main.jsx
├───imports
│   ├───api
│   │       links.js
│   └───ui
│           App.jsx
│           Hello.jsx
│           Info.jsx
├───server
│       main.js
└───tests
        main.js

But when I run meteor, I get this:

      throw error;
      ^

Error: incorrect header check
    at Zlib.zlibOnError [as onerror] (zlib.js:187:17)
 => awaited here:
    at Promise.await (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:60:12)
    at Object.extractTarGz (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\tools\fs\tools\fs\files.ts:791:11)
    at Object.exports._extractAndConvert (C:\tools\packaging\tropohouse.js:47:9)
    at C:\tools\packaging\tropohouse.js:502:42
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at C:\tools\packaging\tropohouse.js:499:24
    at Function.each (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\underscore\underscore-node-f-pre.js:1316:7)
    at C:\tools\packaging\tropohouse.js:466:11
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at Object.download (C:\tools\packaging\tropohouse.js:424:20)
    at C:\tools\packaging\tropohouse.js:610:18
    at C:\tools\utils\buildmessage.js:609:21
    at C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40
 => awaited here:
    at Promise.await (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\promise_server.js:60:12)
    at Object.forkJoin (C:\tools\utils\buildmessage.js:641:6)
    at exports.Tropohouse.downloadPackagesMissingFromMap (C:\tools\packaging\tropohouse.js:606:18)
    at C:\tools\project-context.js:921:25
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at C:\tools\project-context.js:920:20
    at C:\tools\packaging\catalog\catalog.js:100:5
    at Object.capture (C:\tools\utils\buildmessage.js:283:5)
    at Object.catalog.runAndRetryWithRefreshIfHelpful (C:\tools\packaging\catalog\catalog.js:99:31)
    at ProjectContext._downloadMissingPackages (C:\tools\project-context.js:919:13)
    at C:\tools\project-context.js:365:9
    at Object.enterJob (C:\tools\utils\buildmessage.js:388:12)
    at ProjectContext._completeStagesThrough (C:\tools\project-context.js:355:18)
    at C:\tools\project-context.js:347:12
    at Function.run (C:\tools\.meteor\packages\meteor-tool\2.8.0\mt-os.windows.x86_64\tools\tool-env\tools\tool-env\profile.ts:289:14)
    at ProjectContext.prepareProjectForBuild (C:\tools\project-context.js:346:13)
    at C:\tools\runners\run-app.js:554:29
    at Object.capture (C:\tools\utils\buildmessage.js:283:5)
    at bundleApp (C:\tools\runners\run-app.js:553:31)
    at AppRunner._runOnce (C:\tools\runners\run-app.js:625:35)
    at AppRunner._fiber (C:\tools\runners\run-app.js:947:28)
    at C:\tools\runners\run-app.js:408:12 {
  errno: -3,
  code: 'Z_DATA_ERROR'
}

Any help would be greatly appreciated. There doesn’t seem to be a lot of documentation on the errors I’m getting. Perhaps I’m missing something simple.

I wanted to note that we are behind a proxy on both machines I tried.

I was able to fix this by setting the
HTTP_PROXY and HTTPS_PROXY environment variables and using the alternate install instructions.

Error messages were not helpful whatsoever, so this was a (successful) hail-mary.

npm install -g meteor still does not work.
Meteor works just fine in C:\tools\.meteor (so far).