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

Missing dependency on package.json #1

Closed
nolddor opened this issue Sep 13, 2023 · 26 comments
Closed

Missing dependency on package.json #1

nolddor opened this issue Sep 13, 2023 · 26 comments

Comments

@nolddor
Copy link

nolddor commented Sep 13, 2023

Error: Cannot find module 'functions-have-names'
Require stack:

  • /home/nolddor/gems-steam-bot/node_modules/set-function-name/index.js
@chenhui5416

This comment was marked as spam.

@greguz

This comment was marked as spam.

3 similar comments
@micreas

This comment was marked as spam.

@AmirHussain93

This comment was marked as spam.

@rus-tech-ae

This comment was marked as spam.

@snapeuh
Copy link

snapeuh commented Sep 13, 2023

Same problem, package is a dependency of Quill and can't build my app.

@madpilot78
Copy link

As a quick workaround you can just run npm i -D functions-have-names (or equivalent yarn command).

In this way the dependency is fulfilled locally.

@snapeuh
Copy link

snapeuh commented Sep 13, 2023

Yes, we did the same on our project.

@lihqi

This comment was marked as spam.

@timhuebner

This comment was marked as spam.

@OverPa1n

This comment was marked as spam.

@IhorShmidt

This comment was marked as spam.

@tiparega
Copy link

As a quick workaround you can just run npm i -D functions-have-names (or equivalent yarn command).

In this way the dependency is fulfilled locally.

@madpilot78 I tried and didn't work for me, I don't know too much about npm. It allows me to install a tool (cdktf) that uses this, but when I try to run it says it doens't found the module. Do I need to do another thing?

npm i -D functions-have-names
npm install --global cdktf-cli@latest
cdktf get --language java #Fails

@madpilot78
Copy link

madpilot78 commented Sep 13, 2023

As a quick workaround you can just run npm i -D functions-have-names (or equivalent yarn command).
In this way the dependency is fulfilled locally.

@madpilot78 I tried and didn't work for me, I don't know too much about npm. It allows me to install a tool (cdktf) that uses this, but when I try to run it says it doens't found the module. Do I need to do another thing?

npm i -D functions-have-names
npm install --global cdktf-cli@latest
cdktf get --language java #Fails

@tiparega

Yours is a completely different situation. You're installing your tool with the --global npm flag, so you should also install functions-have-names using --global, I guess. But yours is a different situation and I cannot be sure it will be solved this easily.

So, try with --global, but I'm not sure this can fix it in your use case. You'd better ask the cdktf people though.

@tiparega
Copy link

It worked! Thank you!

@sneridagh
Copy link

@ljharb man, this is breaking a lot of builds that use @testing-library/cypress and @testing-library/dom Could you please issue a patch asap?

@ndelangen
Copy link

This is the commit that broke things:
f5e4771

@micreas
Copy link

micreas commented Sep 13, 2023

@ljharb man, this is breaking a lot of builds that use @testing-library/cypress and @testing-library/dom Could you please issue a patch asap?

He is sleeping. Its 4:40 AM at his location. I bet he merged it and went to sleep without testing it much 😄

@ljharb
Copy link
Owner

ljharb commented Sep 13, 2023

@micreas i tested it plenty; all of the places I'm using it already had functions-have-names in node_modules, so I didn't notice this.

I was indeed sleeping; v2.0.1 is now published, which should fix this issue.

For everyone freaking out overnight, don't you people use lockfiles?

@ljharb ljharb closed this as completed Sep 13, 2023
@kenkku
Copy link

kenkku commented Sep 13, 2023

For everyone freaking out overnight, don't you people use lockfiles?

At least some people (including me) were affected when installing CLI tools, such as cdktf-cli, with npm i --global. A good learning experience though, not a good idea to install tools from npm without a lockfile!

@ljharb
Copy link
Owner

ljharb commented Sep 13, 2023

Indeed, virtually nothing should be globally installed :-) CLI tools should be in package.json and invoked with npx.

@ndelangen
Copy link

Thank you @ljharb it's greatly appreciated.
Sorry you had a rough morning. ❤️

@jmustonen
Copy link

For everyone freaking out overnight, don't you people use lockfiles?

For us, this was somewhat deep dependency chain: pdfkit -> fontkit -> deep-equal -> regexp.prototype.flags -- not sure why our lockfile didn't help there though 🤔

But oh well, anyway, thanks for the quick fix ❤️

@akx
Copy link

akx commented Sep 13, 2023

FWIW, eslint-plugin-import has a no-extraneous-dependencies rule that catches dev deps being used at runtime.

@ljharb
Copy link
Owner

ljharb commented Sep 13, 2023

@akx yes, thanks, i'm aware since i'm the maintainer for eslint-plugin-import. i haven't included it in my shared config yet because eslint v8.9 broke parsing for my use case, and I can't update.

@micreas
Copy link

micreas commented Sep 13, 2023

@micreas i tested it plenty; all of the places I'm using it already had functions-have-names in node_modules, so I didn't notice this.

I was indeed sleeping; v2.0.1 is now published, which should fix this issue.

For everyone freaking out overnight, don't you people use lockfiles?

We have a monorepo setup that uses Lerna. We have one lockfile for the monorepo that works locally but for production, the services are being deployed individually without a lockfile because Lerna does not generate individual lockfiles for each service/package. We found out about it when our services started failing in production after deployment because the module was missing and our instances could not start.

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