Error: EACCES: permission denied, rename

I’m attempting to run my server with and am getting an error about renaming a folder that doesn’t exist.

/home/.../.meteor/local/.build742800.build/programs/.build393747.web.browser

This folder does not exist. @fredmaiaarantes, not sure if this is a Meteor 2.7-beta.0 issue or what. I’m going to try going back down to 2.6 next.

I’ve tried deleting .meteor/local, which didn’t change the error.

Command:

meteor run --settings settings.json
=> Started proxy.
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
	Browserslist: caniuse-lite is outdated. Please run:
	npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
	/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
throw error;
^

Error: EACCES: permission denied, rename '/home/.../dev/.../.meteor/local/.build425178.build/programs/.build117388.web.browser' -> '/home/.../dev/.../.meteor/local/.build425178.build/programs/web.browser'
at Object.renameSync (fs.js:797:3)
at /home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1493:23
at Timeout.attempt [as _onTimeout] (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1578:9)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
=> awaited here:
	at Promise.await (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
at rename (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1599:6)
at Object.renameDirAlmostAtomically (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:928:7)
at Builder.complete (/tools/isobuild/builder.js:897:13)
at /tools/isobuild/bundler.js:2925:13
at /tools/isobuild/bundler.js:3058:11
at Array.forEach (<anonymous>)
	at /tools/isobuild/bundler.js:3053:26
	at /tools/isobuild/bundler.js:3426:22
	at Object.capture (/tools/utils/buildmessage.js:283:5)
	at bundle (/tools/isobuild/bundler.js:3232:31)
	at /tools/isobuild/bundler.js:3175:32
	at Slot.withValue (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/@wry/context/lib/context.esm.js:69:29)
	at Object.withCache (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1514:39)
	at Object.bundle (/tools/isobuild/bundler.js:3175:16)
	at /tools/runners/run-app.js:581:24
	at Function.run (/home/.../.meteor/packages/meteor-tool/.2.7.0-beta.0.1q17qf3.uh1b++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
	at bundleApp (/tools/runners/run-app.js:580:34)
	at AppRunner._runOnce (/tools/runners/run-app.js:627:35)
	at AppRunner._fiber (/tools/runners/run-app.js:949:28)
	at /tools/runners/run-app.js:410:12 {
		errno: -13,
		syscall: 'rename',
		code: 'EACCES',
		path: '/home/.../dev/.../.meteor/local/.build425178.build/programs/.build117388.web.browser',
		dest: '/home/.../dev/.../.meteor/local/.build425178.build/programs/web.browser'

Same issue after meteor update --release 2.6

Anyone have any suggestions of what I might try? Thank you.

Similar issue here, but not on rename but on open, and I can’t build the app:

> meteor --exclude-archs web.browser.legacy -p 8765

[[[[[ ~/src/lume+lume/apps/website ]]]]]      

=> Started proxy.                             
=> Started HMR server.                        
=> Meteor 2.14 is available. Check the changelog https://docs.meteor.com/changelog.html and update this project with 'meteor update'.
=> Started MongoDB.                           
/Users/trusktr/.meteor/packages/meteor-tool/.2.12.0.1agbg9i.21x8++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
      throw error;
      ^

Error: EACCES: permission denied, open '/Users/trusktr/src/lume+lume/apps/website/.meteor/local/.build791258.build/programs/.build918003.web.browser/app/App.js'
    at Object.openSync (fs.js:498:3)
    at Object.writeFileSync (fs.js:1529:35)
    at Object.writeFile (/Users/trusktr/.meteor/packages/meteor-tool/.2.12.0.1agbg9i.21x8++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/tools/fs/tools/fs/files.ts:1522:23)
    at Builder.write (/tools/isobuild/builder.js:333:17)
    at /tools/isobuild/bundler.js:2871:11
    at /tools/isobuild/bundler.js:1796:9
    at /tools/isobuild/bundler.js:1718:11
    at Array.forEach (<anonymous>)
    at /tools/isobuild/bundler.js:1717:20
    at Array.forEach (<anonymous>)
    at ClientTarget.<anonymous> (/tools/isobuild/bundler.js:1716:30)
    at ClientTarget.write (/tools/isobuild/bundler.js:1750:5)
    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/trusktr/.meteor/packages/meteor-tool/.2.12.0.1agbg9i.21x8++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/trusktr/.meteor/packages/meteor-tool/.2.12.0.1agbg9i.21x8++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/trusktr/.meteor/packages/meteor-tool/.2.12.0.1agbg9i.21x8++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 {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/Users/trusktr/src/lume+lume/apps/website/.meteor/local/.build791258.build/programs/.build918003.web.browser/app/App.js'
}

I managed to make a reproduction, and the issue seems to be from isobuild in both cases, and seems to be related to symlinked dependencies in node_modules:

Deleting ecmascript, modules, isobuild, etc, and building a new system on top native JS modules might be the same difficulty, if not easier, than trying to adapt the current system.

When @benjamn made the ecmascript and modules system, he started from scratch.

Its pobably better to just start from scratch with a new bare-bones system built on native modules (in Node, and in Browser), then implement optimizations and handling of non-JS file types on top of that).

With Node.js, loaders can be provided that can handle different file types (f.e. import ... from './foo.ts'), and for browsers, service workers can contain “loaders” (and also allow Meteor apps to be PWAs out of the box). Alternatively a client side bundler package could roll everything up.