Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bnegrao opened this issue Aug 25, 2022 · 1 comment

Comments

@bnegrao
Copy link

bnegrao commented Aug 25, 2022

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

@Envek
Copy link
Owner

Envek commented Aug 25, 2022

Show your package.json, probably you have something weird in it, as per error message:

Refusing to install package with name "delete-test-01" under a package
also called "delete-test-01". Did you name your project the same
as the dependency you're installing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants