gpt4 book ai didi

javascript - 为什么 npm install 没有将包安装到/node_modules 文件夹中?

转载 作者:行者123 更新时间:2023-12-05 08:06:19 25 4
gpt4 key购买 nike

当我 npm install package 时,npm 说它成功安装了包,但是当我在 node_modules 文件夹中查找时,包不在该文件夹中。当我 npm install -g package 时,包被安装到全局/node_modules 文件夹中,所以我必须将包从全局文件夹拖到本地文件夹。

为什么 npm install 没有安装到我的本地/node_modules 文件夹中?

最佳答案

步骤 1) rm -rf ./node_modules 从你的根目录。

步骤 2) npm install

The above commands first deletes your node_modules and then reinstalls all the packages that are found inside your package.json.

This is the same problem I was facing, both the above commands resolved the problem in my case.

如果上述解决方案适用于您的情况:

问题是:

数据未从 package.json获取,您必须检查您是否编写了正确的语句不正确 inside 你的 package.json

关于javascript - 为什么 npm install 没有将包安装到/node_modules 文件夹中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61173160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com