Where does npm install packages?

后端 未结 23 1372
梦毁少年i
梦毁少年i 2020-11-22 06:03

Can someone tell me where can I find the Node.js modules, which I installed using npm?

23条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 06:40

    Not direct answer but may help ....

    The npm also has a cache folder, which can be found by running npm config get cache (%AppData%/npm-cache on Windows).

    The npm modules are first downloaded here and then copied to npm global folder (%AppData%/Roaming/npm on Windows) or project specific folder (your-project/node_modules).

    So if you want to track npm packages, and some how, the list of all downloaded npm packages (if the npm cache is not cleaned) have a look at this folder. The folder structure is as {cache}/{name}/{version}

    This may help also https://docs.npmjs.com/cli/cache

提交回复
热议问题