【问题标题】:Error: Cannot find module 'entities/lib/decode_codepoint.js'错误:找不到模块 'entities/lib/decode_codepoint.js'
【发布时间】:2014-10-03 22:05:14
【问题描述】:

我正在使用 Cheerio 模块进行网络抓取。在安装 htmlparser2 之后,它需要 htmlparser2 模块。它给出了以下错误-

Error: Cannot find module 'entities/lib/decode_codepoint.js'

【问题讨论】:

    标签: javascript jquery node.js angularjs express


    【解决方案1】:

    在您的终端中使用它:

    npm install grunt-contrib-jshint --save-dev
    

    在这里看到:

    https://www.npmjs.com/package/grunt-contrib-jshint

    【讨论】:

      【解决方案2】:

      以下仅适用于 Windows 环境,不适用于 Linux。

      当我尝试在 Windows 上从源代码构建 jquery 时,我收到了同样的错误。事实证明,jsdom 和/或 grunt-contrib-jshint(两者都依赖于 htmlparser2)需要gyp,而要让 gyp 工作,您需要一个 c++ 编译器和 python。我以为我有它们,但结果证明,python 需要是 2.x 版而不是 3.x 版。如果它是 3.x,它会在第一次运行时给你一个正确的错误(我错过了),在随后的运行中你会得到上面问题中的错误,这让你想知道发生了什么。

      所以我卸载了 python 3.x,安装了 python 2.x(不要忘记确保 python.exe 在你的路径中),然后删除项目根目录中的 node_modules 文件夹并再次运行构建。

      这次成功了。我不确定这是否解决了 OP 问题,但我希望它可以帮助某人

      【讨论】:

        猜你喜欢
        • 2012-04-10
        • 1970-01-01
        • 1970-01-01
        • 2020-11-30
        • 2015-05-15
        • 2018-02-26
        • 2018-11-02
        • 2016-03-31
        • 1970-01-01
        相关资源
        最近更新 更多