Broken symbolic link with 2.16

I’m getting the following confusing error when trying to run my app on 2.16. I’ve tried to clear out node_modules, package-lock.json and .meteor/local and tried with and without rosetta.

Error: Broken symbolic link encountered at /Users/me/Projects/app/node_modules/create-hash/node_modules/.bin/sha.js
    at isWithinProdPackage (/tools/isobuild/bundler.js:495:19)
    at /tools/isobuild/builder.js:724:15
    at Array.forEach (<anonymous>)
    at walk (/tools/isobuild/builder.js:656:34)
    at /tools/isobuild/builder.js:734:11
    at Array.forEach (<anonymous>)
    at walk (/tools/isobuild/builder.js:656:34)
    at /tools/isobuild/builder.js:734:11
    at Array.forEach (<anonymous>)
    at walk (/tools/isobuild/builder.js:656:34)
    at /tools/isobuild/builder.js:734:11
    at Array.forEach (<anonymous>)
    at walk (/tools/isobuild/builder.js:656:34)
    at Builder._copyDirectory (/tools/isobuild/builder.js:788:5)
    at Builder.copyNodeModulesDirectory (/tools/isobuild/builder.js:550:17)
    at /tools/isobuild/bundler.js:2569:17
    at Function.each (/Users/me/.meteor/packages/meteor-tool/.2.16.0.14ikht8.k8j++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/underscore/underscore-node-f-pre.js:1321:7)
    at JsImage.write (/tools/isobuild/bundler.js:2526:7)
    at ServerTarget.write (/tools/isobuild/bundler.js:2781:13)
    at /tools/isobuild/bundler.js:2949:30
    at /tools/isobuild/bundler.js:3088:11
    at Array.forEach (<anonymous>)
    at /tools/isobuild/bundler.js:3083:26
    at /tools/isobuild/bundler.js:3456:22
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at bundle (/tools/isobuild/bundler.js:3262:31)
    at /tools/isobuild/bundler.js:3205:32
    at Slot.withValue (/Users/me/.meteor/packages/meteor-tool/.2.16.0.14ikht8.k8j++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/@wry/context/lib/context.esm.js:69:29)
    at Object.withCache (/Users/me/.meteor/packages/meteor-tool/.2.16.0.14ikht8.k8j++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/tools/fs/tools/fs/files.ts:1543:39)
    at Object.bundle (/tools/isobuild/bundler.js:3205:16)
    at /tools/runners/run-app.js:579:24
    at Function.run (/Users/me/.meteor/packages/meteor-tool/.2.16.0.14ikht8.k8j++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at bundleApp (/tools/runners/run-app.js:578:34)
    at AppRunner._runOnce (/tools/runners/run-app.js:625:35)
    at AppRunner._fiber (/tools/runners/run-app.js:947:28)
    at /tools/runners/run-app.js:408:12

I found that the symlinks point to expected peer dependencies, so I ran these 2 commands to get my app building again:

meteor npm i -D sha.js
meteor npm i -D miller-rabin

I am facing the same problem after deleting my node_modules folder and trying to run npm i once again. How did you find out which packages were needed? And why does it happen in the first place?

The first line of the error pointed to the missing file, so I just installed the missing package from NPM again.

1 Like

Thanks. I got it working now by doing a meteor npm update.