【问题标题】:Getting "Error: Cannot find module 'esprima'" after updating Meteor to 1.0.2.1将 Meteor 更新到 1.0.2.1 后出现“错误:找不到模块 'esprima'”
【发布时间】:2015-01-10 01:58:56
【问题描述】:

将 Meteor 更新到 1.0.2.1 版后,我收到错误消息:

Error: Cannot find module 'esprima'
W20150109-09:58:02.883(-6)? (STDERR)     at Function.Module._resolveFilename (module.js:338:15)
W20150109-09:58:02.883(-6)? (STDERR)     at Function.Module._load (module.js:280:25)
W20150109-09:58:02.883(-6)? (STDERR)     at Module.require (module.js:364:17)
W20150109-09:58:02.883(-6)? (STDERR)     at require (module.js:380:17)
W20150109-09:58:02.884(-6)? (STDERR)     at Object.Npm.require (/Users/sgidev-005/dev/newProject/.meteor/local/build/programs/server/boot.js:99:18)
W20150109-09:58:02.884(-6)? (STDERR)     at cmd (packages/mrt:server-eval/helpers.js:116:1)
W20150109-09:58:02.884(-6)? (STDERR)     at /Users/sgidev-005/dev/newProject/.meteor/local/build/programs/server/packages/mrt_server-eval.js:850:4
W20150109-09:58:02.884(-6)? (STDERR)     at /Users/sgidev-005/dev/newProject/.meteor/local/build/programs/server/packages/mrt_server-eval.js:906:3
W20150109-09:58:02.885(-6)? (STDERR)     at /Users/sgidev-005/dev/newProject/.meteor/local/build/programs/server/boot.js:175:10
W20150109-09:58:02.885(-6)? (STDERR)     at Array.forEach (native)

这似乎是一个 Node 模块错误,但我知道 Meteor 使用它自己的捆绑版本的 Node,所以我不明白为什么会丢失这个模块。

有没有可能是我的某个软件包导致了这个错误?这是meteor list的结果:

aashu28:bootstrap-validator  0.0.1  bootstrapValidator to validate forms and use bootstrap 3 to show errors
accounts-base                1.1.3  A user account system
accounts-facebook            1.0.3  Login service for Facebook accounts
accounts-google              1.0.3  Login service for Google accounts
accounts-password            1.0.5  Password support for accounts
alanning:roles               1.2.13  Role-based authorization
chrismbeckett:fontawesome4   4.2.2  Scalable vector icons that can be customized with the power of CSS.
email                        1.0.5  Send email messages
joshowens:accounts-entry     1.0.3  Make signin and signout their own pages with routes.
jquery                       1.0.2  Manipulate the DOM using CSS selectors
less                         1.0.12  The dynamic stylesheet language
mrt:bootstrap-growl          0.1.3  Pretty simple jQuery plugin that turns standard Bootstrap alerts into Growl-like notifications.
mrt:iron-router-progress     0.9.3  Progressbar for iron:router
mrt:jquery-ui                1.9.2  jQuery-UI - jQuery user interface
mrt:jquery-ui-bootstrap      1.8.16  jQuery-UI-Bootstrap - custom CSS jQuery UI theme for Twitter Bootstrap
mrt:server-eval              0.6.3  allows client to run js in server context
nemo64:bootstrap             3.3.1_1  Highly configurable bootstrap integration.
noorderstorm:hammer          0.1.3  A javascript library for multi-touch gestures
sacha:spin                   2.0.4  Simple spinner package for Meteor
sewdn:velocityjs             0.8.0  Velocity.js jQuery animation plugin
spiderable                   1.0.6  Makes the application crawlable to web spiders
standard-app-packages        1.0.4  Moved to meteor-platform
underscore                   1.0.2  Collection of small helpers: _.map, _.each, ...

【问题讨论】:

    标签: node.js meteor esprima


    【解决方案1】:

    您似乎安装了错误的 Meteor,esprima 是一个 js 解析器,Meteor 使用它作为工具包的一部分来构建您的项目。您的项目很好,很可能没有遗漏任何东西。

    您可能需要重新安装 Meteor:

    sudo rm -rf ~/.meteor
    curl https://install.meteor.com | sh
    

    【讨论】:

    • 感谢您的建议。我刚试过这个,但我仍然收到完全相同的错误。我是否可能需要手动安装 esprima 模块?
    • @ConorStrejcek 尝试全局安装,也许这将有助于npm install -g esprima。流星的 node_modules 目录有点奇怪,我不确定 esprima 模块的确切位置
    【解决方案2】:

    经过更多的故障排除后,我找到了答案!

    mrt:server-eval 包以某种方式干扰了应用程序编译。删除后,一切都开始正常工作。

    【讨论】:

      猜你喜欢
      • 2013-09-27
      • 1970-01-01
      • 1970-01-01
      • 2014-11-01
      • 2022-01-02
      • 1970-01-01
      • 2014-05-25
      • 2019-06-30
      • 2014-01-28
      相关资源
      最近更新 更多