Unable to resolve some modules: lib/collections
john916zhang opened this issue · comments
John Zhang commented
➜ mantra-sample-blog-app git:(master) ✗ meteor
[[[[[ ~/projects/mantra-sample-blog-app ]]]]]
=> Started proxy.
=> Started MongoDB.
Unable to resolve some modules:
"/Users/mac/projects/mantra-sample-blog-app/lib/collections" in /Users/mac/projects/mantra-sample-blog-app/client/configs/context.js
(web.browser)
Unable to resolve some modules:
"/Users/mac/projects/mantra-sample-blog-app/lib/collections" in /Users/mac/projects/mantra-sample-blog-app/server/publications/posts.js
(os.osx.x86_64)
W20160621-19:20:16.647(8)? (STDERR)
W20160621-19:20:16.835(8)? (STDERR) /Users/mac/.meteor/packages/meteor-tool/.1.3.3_1.1l8kce++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20160621-19:20:16.835(8)? (STDERR) throw(ex);
W20160621-19:20:16.836(8)? (STDERR) ^
W20160621-19:20:16.844(8)? (STDERR) Error: Cannot find module '/Users/mac/projects/mantra-sample-blog-app/lib/collections'
W20160621-19:20:16.845(8)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:85:1)
W20160621-19:20:16.845(8)? (STDERR) at meteorInstall.server.configs.initial_adds.js (server/configs/initial_adds.js:1:1)
W20160621-19:20:16.845(8)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160621-19:20:16.846(8)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160621-19:20:16.846(8)? (STDERR) at /Users/mac/projects/mantra-sample-blog-app/.meteor/local/build/programs/server/app/app.js:269:1
W20160621-19:20:16.846(8)? (STDERR) at /Users/mac/projects/mantra-sample-blog-app/.meteor/local/build/programs/server/boot.js:297:10
W20160621-19:20:16.846(8)? (STDERR) at Array.forEach (native)
W20160621-19:20:16.846(8)? (STDERR) at Function._.each._.forEach (/Users/mac/.meteor/packages/meteor-tool/.1.3.3_1.1l8kce++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160621-19:20:16.847(8)? (STDERR) at /Users/mac/projects/mantra-sample-blog-app/.meteor/local/build/programs/server/boot.js:133:5
=> Exited with code: 8
Unable to resolve some modules:
"/Users/mac/projects/mantra-sample-blog-app/lib/collections" in /Users/mac/projects/mantra-sample-blog-app/client/configs/context.js
(web.browser)
Unable to resolve some modules:
"/Users/mac/projects/mantra-sample-blog-app/lib/collections" in /Users/mac/projects/mantra-sample-blog-app/server/publications/posts.js
(os.osx.x86_64)
Josh commented
Don't use the root path of the collections for importing.
For example: mantra-sample-blog-app/server/publications/posts.js
Replace: import {Posts, Comments} from '/lib/collections';
With: import {Posts, Comments} from './../../lib/collections';
John Zhang commented
it works.
John Zhang commented