Why does npm install a bunch of files and .cmd files on my root folder? If I remove the files and run npm install again, those .cmd files will reappear. Why doesn't npm download those files and stored it into node_modules folder?
When I clone the repo in another computer, it doesn't create those .cmd files. Both computer are running windows 10.
After several testing, I found out that if I delete package-lock.json file first then only perform npm install, then those .cmd won't appear, but then now the project fails to start.
Find the install path. The npm packages installed locally will always be installed on the node_modules/ folder right in your current working directory. For example, when you're on a directory called project/ from the terminal, then it will be inside the project/node_modules folder.
Node Modules Packages are dropped into the node_modules folder under the prefix . When installing locally, this means that you can require("packagename") to load its main module, or require("packagename/lib/path/to/sub/module") to load other modules. Global installs on Unix systems go to {prefix}/lib/node_modules .
on windows: c/Program\ Files/nodejs/node_modules/npm/npmrc.
It is not necessary to do "npm install" each time you want to compile. You just need to do it when you change the dependencies of your project. Show activity on this post. NPM basically is the package manager for node.
This happened to me - the fix on Windows was to go to c:\Users\{username}\.npmrc
and remove the prefix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With