I have only yarn.lock file.I don't have package.json or package-lock.json or node_modules folder.Just only yarn.lock with over ten thousand lines.
I still haven't found any question related to this? Guide me If you know.THANK
Related
I'm trying to run an JS Chrome extension from a cloned repository. The problem occurs after I run npm install where some of the dependencies in the package-lock.json file gets deleted and essentially ignored. This causes the project to miss many of the modules necessary for it to run.
I've tried using npm ci but it still has the same problem. I've also tried using yarn and yarn check but to no avail. What is the problem here? Why doesn't npm install all the dependencies in package-lock.json file without having to delete some of them?
I installed eslint and noticed that it initialized a package-lock.json file and installed a bunch of modules in my node_module folder that I didn't request. I'm not sure why.
More importantly, theres discrepancies between my package.json and package-lock.json listed dependencies. My understanding was that package.json listed my installed dependencies with their semver and package-lock ensured that the exact version i was using is also used by anyone else installing the modules.
So my questions are:
Why are there discrepancies ad shouldn't they have mirror listed dependecies?
Which .json will install dependencies upon request and why?
Why were these installed in the first place from eslint?
Thanks
The dependencies listed on package.json are the ones you install by using npm install.
When you run npm install eslint, npm will add a line in dependencies with eslint and the installed version.
"dependencies": {
"eslint": "^7.5.0"
}
The package-lock.json file contains all dependencies - the ones you installed and the ones required by the other packages. For example, eslint has 36 Dependencies (check the Dependencies tab).
To install a specific version of eslint you should do npm install eslint#7.5.0. The package.json file will now reference that specific version:
"dependencies": {
"eslint": "7.5.0"
}
Note that the ^ symbol is not showing. This symbol means compatible with version and follows semver. You can check other options here.
Whenever I install some packages, runtime.js in regenerator-runtime always removed..
So I always have prepared that files in other folder and pasted when I install some..
It's very vexing thing to me.
It's all same in my all projects where I have this package
who know why this happen??
I don't know why this happens.
just uninstall all node packages and reinstall them then, this problem go away..
Remove yarn.lock (or package.lock)
yarn (npm install)
I have a package.json in the root: "install": "cd packages/my-package && yarn".
When I run yarn run install all I'm asking is that it goes into this package, installs the node_modules and dependencies and that's it. For some reason no matter what I try (yarn workspaces/lerna/manually etc.) it is installing node_modules in all packages, including the root.
WHY?! Just let me install them separately :(
Anyone knows how to easily fix this?
To move the basefolder of node_modules, you will have to create a .yarnrc file in the same directory as your package.json file. Your .yarnrc file should look like
--modules-folder packages/my-packages
The resulting output will put all of your packages after my-packages
/packages/my-packages/WHERE_YOUR_PACKAGES_GO
Is there a Yarn command that compares the node_modules folder with yarn.lock to see if it matches? Alternatively, is there a way to check if new packages have been added to packages.json since the last time yarn install was ran?