安装cnpm报错 Cannot find module 'node:util'
时间: 2023-10-12 19:06:01 浏览: 184
import not model xxx 无论是自己写的包或下载的包 如ImportError: No module named ‘util’
5星 · 资源好评率100%
***pm的版本不匹配导致的。首先,你可以尝试卸载刚刚安装的cnpm,使用命令"npm uninstall cnpm"来卸载。然后,检查你的项目依赖的node_module文件夹中是否缺少了"node:util"模块。如果确实缺少,你可以尝试重新安装这个模块,使用命令"npm install node-sass --save"。注意,这个node-sass包可能在国外的站点上,下载过程可能会容易失败,你可以尝试使用国内的镜像源来安装,例如使用命令"npm install cnpm -g --registry=https://registry.npm.taobao.org"来安装cnpm。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [npm run dev报错 Module build failed: Error: Cannot find module ‘node-sass’](https://download.csdn.net/download/weixin_38660069/14043136)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [cnpm 报错Error_ Cannot find module ‘node_util](https://blog.csdn.net/zhangpchina/article/details/131688700)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文