aws / aws/aws-sam-cli

Bug: `sam build --build-in-source` does not reflect update in local dependency

Open
#7,546 0 comments 0 reactions 0 assignees View on GitHub
area/build area/node-npm stage/needs-investigation type/bug
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:

After installing the local package and building , if you update the local package and then build again, it will not be reflected in the node_modules file.

### Steps to reproduce:

- Download [sam-app.tar.gz](https://github.com/user-attachments/files/17300060/sam-app.tar.gz), extract it
- Go to the hello-world directory
- install local packages
```
$ npm install ../utils/custom-response
```
- build
```
$ cd ../
$ sam build --build-in-source
```
- Update local packages (any update is fine)
```
vi utils/custom-response/index.js
```
- Build again
```
$ sam build --build-in-source --no-cached
```
- Check the packages under the node_modules directory
```
cat hello-world/node_modules/custom-response/index.js
```

### Observed result:

=> The content updated in step 5 is not reflected.

### Expected result:

=> The content updated in step 5 should be reflected.

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

1. OS:
2. `sam --version`:
5. AWS region:

```
# Paste the output of `sam --info` here
```

`Add --debug flag to command you are running`

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.