当前位置:网站首页>(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
2022-06-27 06:47:00 【会说话的字符】
- 出现这个问题时我在网上查了一下,都说要重新下个npm 或者 重装
- 但是在无意间的操作发现 是环境变量 的顺序导致的
- 执行npm的时候会沿着环境变量配置找到对应的路径

这里面确实没有npm包
但是我又想了想,我的npm配置了,安装全局包不是保存的这个文件夹呀,怎么跑这里来找了
然后我就检查了一下全局环境变量

node.js那一层在前面,而这一层就会朝node.js/node_module里面去寻找,因为我设置的node_global才是我全局包存放的地方,所以 node.js/node_module 根本就没有想要的包.而且没找到它居然就直接不找了然后直接报错! 于是我就把顺序改了一下! 结果就好了

然后重启cmd, 输入 npm -v 就好了! 神奇又幸运. bug就这样解决了 - . -

边栏推荐
猜你喜欢

内存屏障今生之Store Buffer, Invalid Queue

Assembly language - Wang Shuang Chapter 8 two basic problems in data processing - Notes

聊聊领域驱动设计

Classical cryptosystem -- substitution and replacement

thrift

Centos7.9 install MySQL 5.7 and set startup

Mathematical modeling contest for graduate students - optimal application of UAV in rescue and disaster relief

面试官:请你介绍一下缓存穿透、缓存空值、缓存雪崩、缓存击穿的,通俗易懂

Redis 缓存穿透、缓存击穿、缓存雪崩

How to download opencv? How to configure opencv after downloading?
随机推荐
tracepoint
【LeetCode】Day90-二叉搜索树中第K小的元素
thrift
解决 Win10 Wsl2 IP 变化问题
Rust Async: smol源码分析-Executor篇
DMU software syntax highlighting VIM setting -- Learning Notes 6
Memory barrier store buffer, invalid queue
Configuring FTP, enterprise official website, database and other methods for ECS
HTAP Quick Start Guide
Redis cache penetration, cache breakdown, cache avalanche
multiprocessing. Detailed explanation of pool
Winow10 installation nexus nexus-3.20.1-01
Visual Studio VS 快捷键使用大全
Meaning of 0.0.0.0:x
获取地址url中的query参数指定参数方法
Fast realization of Bluetooth communication between MCU and mobile phone
大学数据库mysql
观测电机转速转矩
Visual studio vs shortcut key usage
mssql如何使用语句导出并删除多表数据