部署失败,并在Meteor Galaxy中显示“错误:无法找到npm模块”

问题描述 投票:0回答:1

我试图部署到Meteor Galaxy并且它根本不起作用,虽然一切似乎都在localhost上工作。

起初,我的应用程序已上传,但未能启动。至少,容器现在开始,但比我的应用程序崩溃。我认为这是我的应用程序结构中的系统性失败。也许在package.json中缺少一些npm依赖项或者我需要调试一些npm安装?

我不认为我已经完全理解npm如何在Meteor中工作,我需要具有哪些依赖项或者我必须导入/需要正确使用npm包。流星文档没有帮助。

这是我的错误日志:

Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

 meteor npm install --save bcrypt

in the root directory of your application.
/app/bundle/programs/server/node_modules/fibers/future.js:280
    throw(ex);
    ^

Error: Can't find npm module 'meteor/browser-policy-common'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
 at Object.require (/app/bundle/programs/server/boot.js:230:17)
 at makeInstallerOptions.fallback (packages/modules-runtime.js:641:18)
 at require (packages/modules-runtime.js:234:16)
 at meteorInstall.imports.startup.server.browser-policy.js (imports/startup/server/browser-policy.js:1:32)
 at fileEvaluate (packages/modules-runtime.js:333:9)
 at require (packages/modules-runtime.js:228:16)
 at meteorInstall.imports.startup.server.index.js (imports/startup/server/index.js:1:66)
 at fileEvaluate (packages/modules-runtime.js:333:9)
 at require (packages/modules-runtime.js:228:16)
 at meteorInstall.server.main.js (server/main.js:1:14)
 at fileEvaluate (packages/modules-runtime.js:333:9)
 at require (packages/modules-runtime.js:228:16)
 at /app/bundle/programs/server/app/app.js:3668:1
 at /app/bundle/programs/server/boot.js:338:34
 at Array.forEach (native)
 at Function._.each._.forEach (/app/bundle/programs/server/node_modules/underscore/underscore.js:79:11)

无论哪个模块丢失都没关系,似乎Galaxy找不到任何使用过的npm模块。在尝试之前,我与另一个npm模块有同样的错误。比我刚刚在我的代码中删除了该模块的Npm.require。现在,我有同样的错误,只是与另一个模块。

我想在本地使用npm期间我错过了一些东西。我是一个完全的初学者。一切都在当地运作良好,现在我无法上网。我正在使用Windows。

node.js meteor deployment npm npm-install
1个回答
0
投票

这是一个普遍的问题,因为我在添加npm包时从未使用过--save标志,因此在我的package.json中没有它们的依赖关系。我删除了node_modules并为每个npm包运行了meteor npm install --save并且错误已经消失(另外我因其他原因删除了browser-policy package)。

© www.soinside.com 2019 - 2024. All rights reserved.