npm 安装错误:找不到模块“read-package-tree”

时间:2020-12-31 02:28:54

标签: node.js npm

在 windows 10 机器上执行 npm install 命令。

面临以下问题

C:\ >npm install
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'read-package-tree'
npm ERR! Require stack:
npm ERR! - C:\Users\dineshkumars2\AppData\Roaming\npm\node_modules\npm\lib\install.js
npm ERR! - C:\Users\dineshkumars2\AppData\Roaming\npm\node_modules\npm\lib\npm.js
npm ERR! - C:\Users\dineshkumars2\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dineshkumars2\AppData\Roaming\npm-cache\_logs\2020-12-31T02_21_08_042Z-debug.log

1 个答案:

答案 0 :(得分:0)

尝试使用 npm 命令安装 read-package-tree

npm i read-package-tree

如果执行上述命令时出现同样的错误,请从另一台机器复制文件夹并将其粘贴到node_modules所在的路径中。

例如:

C:\Users\MyName\AppData\Roaming\npm\node_modules\npm\node_modules

然后运行下面的命令 npm i read-package-tree 它将解决问题,现在我们可以运行命令 'npm install'