流星无法解析某些模块

meteor unable to resolve some modules

我在安装以下软件包后使用流星,styluspward123:rupturemquandalle:jeet 我收到以下错误。我按照建议尝试了 运行ning meteor npm install --save @babel/runtime 但它没有做任何事情。这是我在尝试 运行 meteor.

时遇到的错误
Unable to resolve some modules:

  "@babel/runtime/helpers/interopRequireDefault" in /C/Users/Anders/sites/jlfitsiteDevelopment/client/lib/modernizr-custom.js (web.browser.legacy)
  "@babel/runtime/helpers/typeof" in /C/Users/Anders/sites/jlfitsiteDevelopment/client/lib/modernizr-custom.js (web.browser.legacy)

If you notice problems related to these missing modules, consider running:

  meteor npm install --save @babel/runtime

W20180622-17:28:30.133(-6)? (STDERR) C:\Users\Anders\sites\jlfitsiteDevelopment\.meteor\local\build\programs\server\boot.js:475
W20180622-17:28:30.134(-6)? (STDERR) }).run();
W20180622-17:28:30.134(-6)? (STDERR)    ^
W20180622-17:28:30.135(-6)? (STDERR)
W20180622-17:28:30.135(-6)? (STDERR) Error: The @babel/runtime npm package could not be found in your node_modules
W20180622-17:28:30.136(-6)? (STDERR) directory. Please run the following command to install it:
W20180622-17:28:30.136(-6)? (STDERR)
W20180622-17:28:30.136(-6)? (STDERR)   meteor npm install --save @babel/runtime
W20180622-17:28:30.136(-6)? (STDERR)
W20180622-17:28:30.137(-6)? (STDERR)     at babel-runtime.js (packages\babel-runtime.js:25:9)
W20180622-17:28:30.137(-6)? (STDERR)     at fileEvaluate (packages\modules-runtime.js:339:7)
W20180622-17:28:30.137(-6)? (STDERR)     at require (packages\modules-runtime.js:238:16)
W20180622-17:28:30.137(-6)? (STDERR)     at packages\babel-runtime.js:79:15
W20180622-17:28:30.138(-6)? (STDERR)     at packages\babel-runtime.js:86:3
W20180622-17:28:30.138(-6)? (STDERR)     at C:\Users\Anders\sites\jlfitsiteDevelopment\.meteor\local\build\programs\server\boot.js:411:36
W20180622-17:28:30.138(-6)? (STDERR)     at Array.forEach (<anonymous>)
W20180622-17:28:30.139(-6)? (STDERR)     at C:\Users\Anders\sites\jlfitsiteDevelopment\.meteor\local\build\programs\server\boot.js:220:19
W20180622-17:28:30.139(-6)? (STDERR)     at C:\Users\Anders\sites\jlfitsiteDevelopment\.meteor\local\build\programs\server\boot.js:471:5
W20180622-17:28:30.139(-6)? (STDERR)     at Function.run (C:\Users\Anders\sites\jlfitsiteDevelopment\.meteor\local\build\programs\server\profile.js:510:12)

.meteor/packages

mongo@1.5.0                   # The database Meteor supports right now
blaze-html-templates    # Compile .html files into Meteor Blaze views
session@1.1.7                 # Client-side reactive dictionary for your app
jquery                  # Helpful client-side library
tracker@1.2.0                 # Meteor's client-side reactive programming library

standard-minifiers@1.1.0      # JS/CSS minifiers run for production mode
es5-shim@4.8.0                # ECMAScript 5 compatibility for older browsers.
ecmascript@0.11.1              # Enable ECMAScript2015+ syntax in app code

autopublish@1.0.7             # Publish all data to the clients (for prototyping)
insecure@1.0.7                # Allow all DB writes from clients (for prototyping)
iron:router
sewdn:masked-input
themeteorchef:jquery-validation
email@1.2.3
johannesma:meteor-flexslider
slam310:smooth-scroll
underscore
stylus
mquandalle:jeet
pward123:rupture

如果没有 package.jsonnode_modules 目录,那肯定是您的问题!

项目的根目录中应该有一个 package.json:

C:\Users\Anders\sites\jlfitsiteDevelopment\

您可能可以安全地从新的 meteor create 复制包 json:

{
  "name": "~name~",
  "private": true,
  "scripts": {
    "start": "meteor run",
    "test": "meteor test --once --driver-package meteortesting:mocha",
    "test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
    "visualize": "meteor --production --extra-packages bundle-visualizer"
  },
  "dependencies": {
    "@babel/runtime": "^7.0.0-beta.51",
    "meteor-node-stubs": "^0.4.1"
  }
}

然后添加您需要的任何额外依赖项

如果这对其他人有帮助:以上答案不适用于我。我有 运行 npm install 来初始化目录,但我的版本有问题 babel/runtime 我一更新到 Meteor 1 就无法正常工作。7.x

我通过运行以下命令降级了babel的版本: meteor npm install --save-exact @babel/runtime@7.0.0-beta.55