Tag: mongoose webpack

Webpack的依赖请求是一个expression式

我正在testing我的新安装程序,为此我编译了一个如下所示的服务器端脚本: import mongoose from 'mongoose'; import User from './models/UserSchema.jsx'; var connStr = 'mongodb://localhost:27017/mongoose-bcrypt-test'; mongoose.connect(connStr, function(err) { if (err) throw err; console.log('Successfully connected to MongoDB'); }); // create a user a new user var testUser = new User({ username: 'jmar777', password: 'Password123' }); // save user to database testUser.save(function(err) { if (err) throw err; // attempt […]

使用webpack在lambda中集成mongoose

我试图设置一个nodejs lambda服务,它使用mongoose连接到一个mongodb。 概要 该webpack调用包含一些警告,没有错误。 lambda服务返回“无法find模块”./node-mongodb-native'。“ 相关链接 尝试在使用Webpack作为模块Bundler的nodejs应用程序中使用mongoose https://github.com/webpack/webpack/issues/1040 https://github.com/Automattic/mongoose/issues/3578 尝试在Webpack上使用带有node-webkit目标的mongoose 细节 webpack调用返回 ./node_modules/.bin/webpack -p –config config/webpack.config.babel.js –display-error-details … WARNING in ./~/mongoose/lib/drivers/index.js Critical dependencies: 8:11-74 the request of a dependency is an expression @ ./~/mongoose/lib/drivers/index.js 8:11-74 WARNING in ./~/mongoose/lib/drivers/SPEC.md Module parse failed: /pathReplacement/node_modules/mongoose/lib/drivers/SPEC.md Unexpected character '#' (2:0) You may need an appropriate loader to handle this […]

找不到模块:错误:在与webpack绑定时无法parsing模块“模块”mongodb

当我尝试在我的节点应用程序中使用mongoose连接时,Webpack会抛出以下错误。 最初有一些更多的错误, Module not found: Error: Cannot resolve module 'fs' 在我的webpackconfiguration文件中做出以下更改的窍门, 我在我的webpackconfiguration文件中添加了节点加载器和节点对象。 节点:{console:'empty',fs:'empty',net:'empty',tls:'empty'}, 但波纹pipe的错误仍然存​​在。 任何想法如何解决它? WARNING in ./~/mongoose/~/mongodb/~/mongodb-core/~/require_optional/index.js Critical dependencies: 63:18-42 the request of a dependency is an expression 71:20-44 the request of a dependency is an expression 78:35-67 the request of a dependency is an expression @ ./~/mongoose/~/mongodb/~/mongodb-core/~/require_optional/index.js 63:18-42 71:20-44 78:35-67 WARNING in ./~/mongoose/~/mongodb/~/mongodb-core/~/require_optional/README.md […]

尝试在webpack上使用mongoose时,会得到大量的神秘错误和警告

我正在使用webpack将es6同构反应应用程序分别编译到客户端和服务器包中。 我已经安装mongoose,并试图在我的应用程序的服务器部分使用它,但是当我尝试构build时,在控制台中出现了一些可怕的错误: 警告在./~/mongoose/lib/drivers/index.js关键依赖关系:8:11-74依赖关系的请求是expression式@ ./~/mongoose/lib/drivers/index.js 8:11-74 警告在./~/mongoose/lib/drivers/SPEC.md模块分析失败:/Users/richie/Code/CreativeFlumeProjects/cf-website/node_modules/mongoose/lib/drivers/SPEC.md第2行:意外的标记非法您可能需要一个合适的加载器来处理这个文件types。 | | #驱动程序规格| | TODO @ ./~/mongoose/lib/drivers ^。/。* $ 警告在./~/express/lib/view.js关键依赖:78:29-56依赖的请求是一个expression式@ ./~/express/lib/view.js 78:29-56 警告./~/es6-promise/dist/es6-promise.js模块未find:错误:无法parsing/ Users / richie / Code / CreativeFlumeProjects / cf-website / node_modules / es6-promise / dist中的模块“vertx”在/ Users / richie / Code / CreativeFlumeProjects / cf-website / src / Users / richie / Code / CreativeFlumeProjects中find/ Users / […]