Skip to content

Error 'Refusing to install package with name "delete-test-01" under a package' #17

@bnegrao

Description

@bnegrao

Hi Envek, first of all thank you for this amazing project. I think it is still relevant because the implementation of AWS 'sam build' with esbuild results in a huge ".js" file with all the dependencies embedded in it, that's why I searched for your project.

I cloned your repository, then I ran "npm install", then "sam.cmd build" (i am on windows 10). Then I received the error bellow:

$ sam.cmd build
Your template contains a resource with logical ID "ServerlessRestApi", which is a reserved logical ID in AWS SAM. It could result in unexpected behaviors and is not recommended.
Building layer 'RuntimeDependenciesLayer'
Running CustomMakeBuilder:CopySource
Running CustomMakeBuilder:MakeBuild
Current Artifacts Directory : C:/Users/bnegrao/perch/aws-sam-typescript-layers-example/.aws-sam/build/RuntimeDependenciesLayer
mkdir -p "C:/Users/bnegrao/perch/aws-sam-typescript-layers-example/.aws-sam/build/RuntimeDependenciesLayer/nodejs"
cp package.json package-lock.json "C:/Users/bnegrao/perch/aws-sam-typescript-layers-example/.aws-sam/build/RuntimeDependenciesLayer/nodejs/"
npm install --production --prefix "C:/Users/bnegrao/perch/aws-sam-typescript-layers-example/.aws-sam/build/RuntimeDependenciesLayer/nodejs/"

Build Failed
Error: CustomMakeBuilder:MakeBuild - Make Failed: npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "delete-test-01" under a package
npm ERR! also called "delete-test-01". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bnegrao\AppData\Roaming\npm-cache\_logs\2022-08-25T03_37_54_922Z-debug.log
make: *** [C:\Users\bnegrao\perch\aws-sam-typescript-layers-example\Makefile:23: build-RuntimeDependenciesLayer] Error 1

I am new to typescript and javascript, so I am sorry if that's a silly issue.

Regards,
bruno

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions