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
Yarn install does not install missing modules in node_modules #2240
Comments
Any news on that? Thx. |
Interestingly, I found that this doesn't affect new packages:
My guess is that |
Same issue here. I would expect that yarn installs packages missing from my node_modules folder when I use the |
Yep, this is definitely something to do with the integrity check. If you run This is potentially problematic also if you switch a package from What we need is for |
Any updates on this? This is causing lots of wasted time here at Tableau. |
To add to this, if you |
Thanks for the tip @chlab, that was driving me nuts. |
Looks like |
@pribilinskiy yarnpkg/website#497 |
@pribilinskiy @raido I've found |
@luchillo17 the |
@pribilinskiy Indeed its a nuke solution. |
Tried everything here, then realized I was in the wrong directory in my cli... 30 mins later 😭 😆 |
|
I had what seemed like the same problem, but my issue ended up being the NODE_ENV var was accidentally set to |
Experienced the same when we pulled a devDependency from a remote repository. We had to manually execute |
i tried everything in here , but still facing this error . i mentioned script to start server and `npm start first@1.0.0 start /home/vamshi/myApps/node/first module.js:540 Error: Cannot find module './node.js' npm ERR! A complete log of this run can be found in: |
@vamshi9666, you're using npm, and this issue is about yarn. If you installed packages with yarn I guess you should use This |
even yarn start gives same error in log @squadette |
I had this issue but turns out it was not wit yarn but with Webstorm. |
I don't think this scenario is actually broken. The reproduction steps you mentioned don't match this scenario. When you run yarn, it creates a "node_modules/.yarn-integrity" file listing out everything it installed in node_modules if that file isn't already present. If it is present, yarn compares that file (and not the rest of node_modules) against yarn.lock to see what needs to be changed. So if one developer commits some changes to package.json and yarn.lock (because they run |
I think this happened to me in a docker container, when package versions have been upgraded. The container runs Alpine linux, which only has yarn 1.7.0 in its stable repository. Installing yarn 1.12.3 from the edge repositories fixed the problem, but here's what happens anyway in case other people are in the same boat:
Here's the relevant output of the commands:
But here's some information from
Sure enough, it skipped a ton of stuff:
The only thing that works without upgrading is blowing away the |
I've run into this issue. I solve this problem with: rm -rf node_modules yarn.lock
npm install
yarn import
yarn install --check-files Looks like it worked! |
I had the same issue, thats it. |
Out of all comments, the only thing that helps in my case is: In all other cases, after deleting EDIT: also, after each |
I also get this. yarn 1.17.3 |
This saved me, thank you. I am working with mixed project (java, kotlin, javascript and typescript) in a monorepo. I was thinking that the problem was on the frontend-maven-plugin, but after using your workaround it works perfectly. For people that may stumble upon this issue: I am using workspaces and maven multimodules, maven coordinates build hierarchy, workspaces coordinates yarn dependencies (it looks complicated but it is actually very simple, I am surprised that there are no tutorials of it around the web, maybe it is just to niiche). There is a section on the plugin called <environmentVariables>
<NODE_ENV>production</NODE_ENV>
<BABEL_ENV>build</BABEL_ENV>
<TS_NODE_PROJECT>\"./tsconfig.eslint.json\"</TS_NODE_PROJECT>
</environmentVariables> Now, for some god knows why reason, if I remove this variables, the build works, but I need to prefix every script with With That concludes my random rambling. I hope this turns out to be useful for someone. Thank you. EDIT: https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-production-true-false yep. |
Any progress on this one? I have the situation that I need to deploy apps on the server and update there the I've tried several solutions proposed here, but not all are working well. For me, it seems that |
People asking the same question 4 years later, even with solid repro? 🙊 😅 I ran into same issue as well. Any news on this please? Here's my repro (same as mentioned in the OP's repo) ...
"dependencies": {
"project_folder": "file:submodules/some_submodule",
...
Let me know if you need more information please. I am on |
This Worked Perfectly :) |
Removing |
I just had a similar issue. In my case, there was Wonderful software. Update: seems that yarn is innocent in installing eslint, as it is seems to be included as a runtime dependency of some packages. However, it is still a counter-intuitive that the package manager has multiple ways (env + CLI flags) to control which packages should be installed. Especially, when there are no messages which mode will be used. |
This commit uses the command `yarn import` to generate a `yarn.lock` file from an existing `package-lock.json`. Unfortunately, a [known bug](yarnpkg/yarn#2240) exists. When one runs `yarn install`, yarn **does not** actually install the dependencies in `node_modules`; instead it only creates a "yarn integrity check file." To actually install the dependencies, one must run: - `yarn import` - `rm -rf node_modules` - `yarn install` - `rm -rf package-lock.json` (to avoid future warnings about multiple lock files).
It's incredible that this issue is still ongoing since 2016. |
I've fixed the problem by adding line
|
remove |
Yea... incredible is an understatement -- such a basic option, is there no solution to recheck node_modules (no, I don't want to delete lock file). |
I noticed that
and then |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Missing module directories in node_modules are not installed when running yarn install after you get the message "success Already up-to-date". Please note that a work around is to always run yarn install --force, however that slows down yarn install if no new modules are needed. Also everything seems to work with yarn install if the node_modules directory is deleted.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
If a module is missing from node_modules (i.e. directory is not there) yarn should install the missing module and not report everything is up to date.
Think of a multi developer environment where one developer installs a module and updates the source control with the updated yarn.lock file and/or offline cache but not the node_modules directory. Another developer updates and then runs yarn install, which should not report back that everything is up to date.
Please mention your node.js, yarn and operating system version.
yarn 0.17.10
node.js 6.9.2
os CentOS 6.7 (I also tested on Windows)
The text was updated successfully, but these errors were encountered: