执行npm安装模块的命令Cannotfindmodule

执行npm安装模块的命令Cannotfindmodule

2023年7月26日发(作者:)

执⾏npm安装模块的命令Cannotfindmodulenpm 安装了 appium 和 appium-doctor 运⾏命令,appium-doctor 提⽰找不到模块:C:Usersautotest>:471throw err;^Error: Cannot find module 'C:WindowsSystem32node_'at ._resolveFilename (:469:15)at ._load (:417:25)at n (:604:10)at run (bootstrap_:394:7)at startup (bootstrap_:149:9)at bootstrap_:509:3C:Usersautotest>

appium 是通过-g 全局安装的,安装的⽬录为:C:UsersautotestAppDataRoamingnpm执⾏命令获取:C:Usersautotest>npm config get prefixC:UsersautotestAppDataRoamingnpm设置环境变量都不起作⽤,重新安装nodejs 、npm 安装appium-doctor 再运⾏都不⾏。磁盘搜索"appium" 关键字,发现"C:WindowsSystem32"下⾯有appium 和appium-doctor ⽂件。原来执⾏的都是这个地⽅的命令,⽽这个⽬录下⾯的node_modules ⽂件夹早就被删除了。所以出现这个提⽰:回想事情发⽣的原因,原来是通过管理员运⾏cmd ,默认进⼊的⽬录是:C:WindowsSystem32 。有次执⾏安装appium 没有使⽤参数-g 导致就直接在这个⽬录下⾯安装了appium 和appium-doctor ,⽣成了appium、appium-doctor⽂件 和⼀个⽬录C:WindowsSystem32node_modules。只删除了 ⽬录C:WindowsSystem32node_modules,⽽没有删除C:WindowsSystem32 下⾯的相关⽂件。总结:以后遇到类似找不到模块,解决问题⽅法:直接进⼊提⽰的路径的node_nodules 上⼀层⽬录,如提⽰:C:WindowsSystem32node_ 进⼊⽬录C:WindowsSystem32,删除输⼊的命令即可

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1690359690a337599.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信