aws-amplify / aws-amplify/amplify-cli

Failed to pull the backend. - ENOENT: no such file or directory, realpath

Open
#10,032 18 comments 1 reaction 0 assignees View on GitHub
bug dependency-issue p2 windows
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

16.14.2

### Amplify CLI Version

7.6.25

### What operating system are you using?

Windows 11

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made.

### Amplify Categories

auth, storage, function, api

### Amplify Commands

pull

### Describe the bug

Project was previously worked on a different device. Setting this up on a new device for the first time created this issue.

The ENOENT error appears to involve a function lambda layer looking for the file/directory realpath in "function\\lib\nodejs\node_modules\browser-resolve\node_modules\resolve\test\pathfilter\deep_ref\node_modules\deep\deeper". It appears the sub-directory "deep_ref" does not exist but the sub-directories after that do exist.

Deleting any files related to amplify does not solve the issue.

### Expected behavior

Amplify should be able to pull the project environment without error, including for any lambda layers.

### Reproduction steps

Not sure if this will be reproducible for others as it appears to involve a lambda layer issue.

1. Using an existing backend with a lambda layer in the function category, pull an environment on a new device

### GraphQL schema(s)

_No response_

### Log output

```
Backend environment 'dev' found. Initializing...
Failed to pull the backend.
ENOENT: no such file or directory, realpath 'C:\...\amplify\.temp\#current-cloud-backend\function\\lib\nodejs\node_modules\browser-resolve\node_modules\resolve\test\pathfilter\deep_ref\node_modules\deep\deeper'

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.