2016-09-09 22 views
2

ローカルホストで完全に動作するMeteorアプリケーションがありますが、リモートherokuサーバーに展開すると、次のエラーが発生します。エラー:npmモジュール 'moment'を見つけることができません

これをしてください修正する方法任意のアイデア

(私はthisを実装していますか)?

2016-09-09T13:26:02.533532+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js` 
2016-09-09T13:26:06.806440+00:00 heroku[web.1]: Process exited with status 1 
2016-09-09T13:26:06.813921+00:00 heroku[web.1]: State changed from starting to crashed 
2016-09-09T13:26:06.704013+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280 
2016-09-09T13:26:06.704027+00:00 app[web.1]:      throw(ex); 
2016-09-09T13:26:06.704028+00:00 app[web.1]:      ^
2016-09-09T13:26:06.704029+00:00 app[web.1]: 
2016-09-09T13:26:06.704030+00:00 app[web.1]: Error: Can't find npm module 'moment'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package? 
2016-09-09T13:26:06.704031+00:00 app[web.1]:  at Object.Npm.require (/app/.meteor/heroku_build/app/programs/server/boot.js:198:17) 
2016-09-09T13:26:06.704032+00:00 app[web.1]:  at options.fallback (packages/modules-runtime/modules-runtime.js:21:1) 
2016-09-09T13:26:06.704032+00:00 app[web.1]:  at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:88:1) 
2016-09-09T13:26:06.704033+00:00 app[web.1]:  at meteorInstall.server.main.js (server/main.ts:1:19) 
2016-09-09T13:26:06.704035+00:00 app[web.1]:  at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) 
2016-09-09T13:26:06.704035+00:00 app[web.1]:  at server/main.ts:65:4 
2016-09-09T13:26:06.704036+00:00 app[web.1]:  at /app/.meteor/heroku_build/app/programs/server/boot.js:292:10 
2016-09-09T13:26:06.704036+00:00 app[web.1]:  at Array.forEach (native) 

私がにログインすると、英雄にログオンします。 /app/typings/globalsで、私は以下を参照してください。

es6-collections es6-promise google-maps google.maps meteor moment 

これは、Windowsのローカルホスト上にあるものと一致しているようだ:

enter image description here

瞬間もnode_modules

enter image description here

に存在してここにありますmy node_modules\moment\package.js

var profile = { 
    resourceTags: { 
     ignore: function(filename, mid){ 
      // only include moment/moment 
      return mid != "moment/moment"; 
     }, 
     amd: function(filename, mid){ 
      return /\.js$/.test(filename); 
     } 
    } 
}; 

マイpackage.json:ログから

{ 
    "dependencies": { 
    "@angular/common": "^2.0.0-rc.4", 
    "@angular/compiler": "^2.0.0-rc.4", 
    "@angular/core": "^2.0.0-rc.4", 
    "@angular/forms": "^0.2.0", 
    "@angular/http": "^2.0.0-rc.4", 
    "@angular/platform-browser": "^2.0.0-rc.4", 
    "@angular/platform-browser-dynamic": "^2.0.0-rc.4", 
    "@ionic/cloud-angular": "^0.4.0", 
    "angular2-meteor": "^0.6.2", 
    "angular2-moment": "^0.8.2", 
    "es6-shim": "^0.35.0", 
    "ionic-angular": "^2.0.0-beta.11", 
    "ionic-native": "1.3.2", 
    "ionicons": "3.0.0", 
    "meteor-client-side": "^1.3.4", 
    "moment": "^2.14.1", 
    "reflect-metadata": "^0.1.3", 
    "rxjs": "5.0.0-beta.6", 
    "socket.io": "^1.4.8", 
    "zone.js": "^0.6.12" 
    }, 

スニペット展開:

remote: -----> Building Meteor app with ROOT_URL: https://git.heroku.com/remote-thewhozoo.git 
remote: server/collections.ts (1, 21): Cannot find module 'meteor/mongo'. 
remote: server/collections.ts (2, 29): Cannot find module 'api/models'. 
remote: server/methods.ts (1, 22): Cannot find module 'meteor/meteor'. 
remote: server/methods.ts (2, 28): Cannot find module 'meteor/check'. 
remote: server/main.ts (1, 25): Cannot find module 'moment'. 
remote: server/main.ts (2, 22): Cannot find module 'meteor/meteor'. 
remote: 
remote: Unable to resolve some modules: 
remote: 
remote: "moment" in /tmp/build_29ec6195d953bd56c0670f7d9ee489a4/server/main.js 
remote: (os.linux.x86_64) 
remote: 
remote: If you notice problems related to these missing modules, consider running: 
remote: 
remote: meteor npm install --save moment 
remote: 
remote: -----> Moving built slug to /tmp/build_29ec6195d953bd56c0670f7d9ee489a4/.meteor/heroku_build/app 
remote: -----> Installing npm production dependencies on built slug 
remote: 
remote: > [email protected] install /tmp/build_29ec6195d953bd56c0670f7d9ee489a4/.meteor/heroku_build/app/programs/server/node_modules/fibers 
remote: > node build.js || nodejs build.js 
remote: 
remote: `linux-x64-v8-4.5` exists; testing 
remote: Binary is fine; exiting 
remote: 
remote: > [email protected] install /tmp/build_29ec6195d953bd56c0670f7d9ee489a4/.meteor/heroku_build/app/programs/server 
remote: > node npm-rebuild.js 
remote: 
remote: { 
remote: "meteor-dev-bundle": "0.0.0", 
remote: "npm": "3.10.6", 
remote: "ares": "1.10.1-DEV", 
remote: "http_parser": "2.7.0", 
remote: "icu": "56.1", 
remote: "modules": "46", 
remote: "node": "4.5.0", 
remote: "openssl": "1.0.2h", 
remote: "uv": "1.9.1", 
remote: "v8": "4.5.103.37", 
remote: "zlib": "1.2.8" 
remote: } 

index.d.ts

declare module 'moment' { 
    var moment: moment.MomentStatic; 
    export = moment; 
} 

私はのルートにシンボリックリンクを持っています流星のプロジェクト:

enter image description here

UPDATE

私は私が考える問題を発見したが、私はまだそれを解決する方法が100%を確認していません。

シンボリックリンクは、ローカルに存在するがリモートサーバーには存在しないディレクトリを指しているという問題があります。

enter image description here

UPDATE

私はすべてのシンボリックリンクを削除し、代わりにそこにあるファイルを持って、展開、およびサーバが起動しようとしたとき、私はまだ同じエラーを取得:

2016-09-11T15:23:06.155551+00:00 heroku[web.1]: State changed from crashed to starting 
2016-09-11T15:23:09.146909+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js` 
2016-09-11T15:23:13.712742+00:00 heroku[web.1]: State changed from starting to crashed 
2016-09-11T15:23:13.640003+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280 
2016-09-11T15:23:13.640048+00:00 app[web.1]:      throw(ex); 
2016-09-11T15:23:13.640073+00:00 app[web.1]:      ^
2016-09-11T15:23:13.640075+00:00 app[web.1]: Error: Can't find npm module 'moment'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package? 
2016-09-11T15:23:13.640076+00:00 app[web.1]:  at Object.Npm.require (/app/.meteor/heroku_build/app/programs/server/boot.js:198:17) 
2016-09-11T15:23:13.640077+00:00 app[web.1]:  at options.fallback (packages/modules-runtime/modules-runtime.js:21:1) 
2016-09-11T15:23:13.640078+00:00 app[web.1]:  at meteorInstall.server.main.js (server/main.ts:1:19) 
2016-09-11T15:23:13.640079+00:00 app[web.1]:  at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) 
2016-09-11T15:23:13.640079+00:00 app[web.1]:  at server/main.ts:65:4 
2016-09-11T15:23:13.723869+00:00 heroku[web.1]: Process exited with status 1 

どのようなアイデアをお願いしますか?

私が実行した:meteor npm install --save

私はboot.jsでこれを発見したが、私は作者が何をしていたかわかりません。

try { 
     return require(name); 
    } catch (e) { 
     // Try to guess the package name so we can print a nice 
     // error message 
     // fileInfo.path is a standard path, use files.pathSep 
     var filePathParts = fileInfo.path.split(files.pathSep); 
     var packageName = filePathParts[1].replace(/\.js$/, ''); 

     // XXX better message 
     throw new Error(
     "Can't find npm module '" + name + 
      "'. Did you forget to call 'Npm.depends' in package.js " + 
      "within the '" + packageName + "' package?"); 
     } 

UPDATE

私はnode_modules/.gitignoreを除去し、私は今、すべてのエラーを得ることはありません。

enter image description here

しかし、私は流星に新しいので、これをテストする方法がわからないです。私はhttp://remote-thewhozoo.herokuapp.com/https://remote-thewhozoo.herokuapp.com/でアプリを起動しようとすると、しかし、私は404エラーを取得:

2016-09-11T16:20:15.183895+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=jwgw2yuvgl" host=remote-thewhozoo.herokuapp.com request_id=a49fafb2-9708-46d2-8117-2c789bfa6a3e fwd="105.186.215.147" dyno=web.1 connect=1ms service=2ms status=404 bytes=132 

enter image description here

私はMongoのデータベースをチェックしますか、それは私のアプリで作成されたコレクションを持っています。だから流星が走っているに違いない、私はそれにアクセスする方法を知らない。

enter image description here

任意のアイデアしてください?

+0

私のlocalhostはWindowsマシンであり、herokuはLinuxです。大文字と小文字の区別が問題なのでしょうか? – Richard

答えて

0

meteor npm installあなたのプロジェクトのルートにお試しいただけますか?

このリストに瞬間がない場合は、meteor npm install --save momentを試すことができますか?

そうしないと、あなたはあなたのpackage.jsを投稿してください可能性 - それはアプリ/プログラムにする必要があります/サーバー/

+0

ありがとう、私は今それを試みて忙しいです。私は 'git push 'をやっています。簡単な質問ですが、 'node_modules'の' gitignore'を持つのは正しいですか? – Richard

+0

これは問題ありません。新しいマシンにクローンを作成するか、依存関係を変更した後にプルするたびに 'npm install'を忘れないようにしてください。 – sitarhero

+0

私は 'meteor npm install --save moment'を試しますが、' git add/commit/push'を実行しようとすると、変更はありません。 'あなたの支店は 'origin/master''と最新です。どんなアイデアですか? – Richard

4

この行を確認してください:"moment": "^2.14.1"はあなたのpackage.json ですし、私が思うnpm install

+0

私は 'package.json'を上記の質問に追加しました。 "^ 2.14.1" ' – Richard

+1

問題がまだ残っているなら、後で明らかにあなたの流星のルートディレクトリにある' npm install -g moment'と 'npm install moment'の両方を実行します。 – Loay

+0

'meteor npm install --save moment'と' npm install -g moment'と 'npm install moment'を試してみますが、' git add/commit/push'を実行しようとすると、変更はありません。 'あなたの支店は 'origin/master''と最新です。どんなアイデアですか? – Richard

関連する問題