Error: Cannot find module 'node:util'
时间: 2023-08-22 20:10:39 浏览: 234
这个错误通常是由于npm版本与cnpm版本不匹配导致的。你可以尝试卸载刚刚安装的cnpm,使用以下命令:npm uninstall cnpm。然后,你可以尝试重新安装cnpm,确保使用与你的npm版本兼容的cnpm版本。如果你在Mac电脑上进行全局安装,你可能需要在命令前加上sudo以获取全局安装权限。例如:sudo npm install cnpm -g --registry=https://registry.npm.taobao.org。这样应该能解决这个问题。\[2\]\[3\]
#### 引用[.reference_title]
- *1* [Centos7中安装Node出现Cannot find module ‘../lib/utils/unsupported.js‘问题](https://blog.csdn.net/weixin_38080573/article/details/118296776)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [cnpm 安装报错Error_ Cannot find module ‘node_util](https://blog.csdn.net/JZH20/article/details/131049189)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文