0
で見つけることができません。しかし、node.jsアプリケーションを実行すると、次のランタイムエラーが発生します。package.jsonモジュールは、私はローカルパスを持っている私のpackage.jsonに2つのパッケージを持っているランタイム
module.js:529
throw err;
^
Error: Cannot find module 'subscriptions-transport-ws'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/nbhati/projects/graphql-bookstore-server/src/app.factory.js:6:1)
at Module._compile (module.js:624:30)
at loader (/Users/nbhati/projects/graphql-bookstore-server/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/nbhati/projects/graphql-bookstore-server/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
私は何が欠けていますか?
ファイルが必要か、またはモジュールに 'index.js'があることを確認してください。 –
'node_modules'フォルダは、あなたのアプリと同じディレクトリ(または先祖ディレクトリ)にありますか? – cybersam
ありがとうございます。はい、私はパッケージをインポートしています。はい、node_modulesフォルダは、アプリケーションのindex.jsの1つ上のレベルです。私はデバッグのためにそこにいくつかのconsole.logを入れているので、2つのパッケージをローカルパスに入れます。それ以外の場合は、npmから直接取得すると、コードで正常に動作します。 – Naresh