gpt4 book ai didi

node.js - 错误:尽管模块已全局安装,但找不到模块

转载 作者:太空宇宙 更新时间:2023-11-04 01:45:36 25 4
gpt4 key购买 nike

我正在使用Intellij Idea,并且试图运行使用Puppeteer模块的Node脚本。当我在Intellij Idea之外运行脚本时,它可以正常工作。但是当我在内部运行它时,出现以下错误:

Error: Cannot find module 'puppeteer'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/myuser/.rvm/gems/ruby-2.1.2@core/bundler/gems/docket-plus-43e0140393ef/lib/data/js/county/practice.js:6:19)


基本上,脚本位于存储在文件系统其他位置的ruby gem中。我从另一个项目运行脚本。但是我在全球范围内用npm设置了puppeteer:

npm install -g puppeteer


这意味着无论我在哪里运行脚本,都应找到the。我为Intellij Idea安装了NodeJS插件,并且在首选项中看到了puppeteer:

enter image description here

但是我继续得到这个错误。为什么找不到伪人模块?

最佳答案

我遇到了同样的问题,但是在本地目录中重新安装解决了该问题。

关于node.js - 错误:尽管模块已全局安装,但找不到模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51603947/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com