question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: files.at is not a function | Setting up dev environment

See original GitHub issue

The problem

I tried to start development in my Windows system, but I got this error.

PS D:\projects\desktop> yarn
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.2.1: The platform "win32" is incompatible with this module.
info "fsevents@2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "win32" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > parallel-webpack@2.3.0" has incorrect peer dependency "webpack@^1.12.9 || ^2.2.0 || ^3.x || ^4.x".
[5/5] Building fresh packages...
$ ts-node -P script/tsconfig.json script/post-install.ts

D:\projects\desktop\node_modules\once\once.js:25
    return f.value = fn.apply(this, arguments)
                        ^
TypeError: files.at is not a function
    at D:\projects\desktop\script\post-install.ts:26:57
    at f (D:\projects\desktop\node_modules\once\once.js:25:25)
    at Glob.<anonymous> (D:\projects\desktop\node_modules\glob\glob.js:151:7)
    at Glob.emit (events.js:400:28)
    at Glob.emit (domain.js:475:12)
    at Glob._finish (D:\projects\desktop\node_modules\glob\glob.js:197:8)
    at done (D:\projects\desktop\node_modules\glob\glob.js:182:14)
    at Glob._processReaddir2 (D:\projects\desktop\node_modules\glob\glob.js:434:12)
    at D:\projects\desktop\node_modules\glob\glob.js:371:17
    at RES (D:\projects\desktop\node_modules\inflight\inflight.js:31:16)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Release version

Development

Operating system

Microsoft Windows 10 Home Single Language | 10.0.19044 | 19041.1.amd64fre.vb_release.191206-1406

Steps to reproduce the behavior

git clone https://github.com/desktop/desktop.git
yarn

I didn’t have to install any other tools, as I already had them installed.

Log files

No response

Screenshots

image

Additional context

PS D:\projects\desktop> node -v
v14.18.0
PS D:\projects\desktop> nvm v
1.1.9
PS D:\projects\desktop> python --version
Python 3.9.7

I have been following this documentation: https://github.com/desktop/desktop/blob/development/docs/contributing/setup-windows.md

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
niikcommented, Aug 12, 2022

Hey @maifeeulasad, thanks for reaching out! It looks like you are using an older version of Node.js than what’s required.

PS D:\projects\desktop> node -v
v14.18.0

We’re currently using 16.13.0 (see .node-version) which is necessary to support the new .at method for arrays. We’ve begun it (Array.prototype.at) in a number of places already and we expect to use it more and more so we’re not keen on reverting those changes.

Please install Node 16.13.0 (either globally or using a version manager, see https://github.com/desktop/desktop/blob/node-16-recommendation/docs/contributing/setup-windows.md#i-need-to-use-different-versions-of-nodejs-in-different-projects

I’m going to close this issue but let us know if upgrading Node didn’t solve your issue and we’ll continue troubleshooting.

xref https://github.com/desktop/desktop/pull/14907

1reaction
maifeeulasadcommented, Aug 13, 2022

Thanks, @niik, it worked.

And really appreciate your help, @tsvetilian-ty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: environment.setup is not a function in React Testing
My issue solve with this: . If you have both react-scripts and jest in your package.json, delete jest from it. Then delete package-lock.json, ......
Read more >
TypeError: lookup.flatMap is not a function - SharePoint Stack ...
This is the issue related to yeoman. You can fix this issue by downgrading it from 4.0.0 to 3.1.1 npm install yo@3.1.1 -g....
Read more >
Strict mode - JavaScript - MDN Web Docs
JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode".
Read more >
Configuring Jest compiled - w3resource
Always remember that the resulting configuration must be JSON-serializable. When you are using the --config option, the JSON file should not ...
Read more >
Error TypeError is not a function in Node js | Edureka Community
Hello @kartik,. Because of circular dependency, check if you have 2 classes that are requiring each other, remove one of them from requiring...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found