Coder Social home page Coder Social logo

my-node-blog's People

Contributors

leotian avatar

Watchers

 avatar  avatar

my-node-blog's Issues

extraneous错误

“npm ERR! extraneous means a package is installed but is not listed in your project's package.json.”
错误的原因是项目的package.json中没有添加模块信息,则会报extraneous错误的模块信息。
package.json:存储着工程的信息及模块依赖,当在 dependencies 中添加依赖的模块时,运行 npm install,npm 会检查当前目录下的 package.json,并自动安装所有指定的模块,安装目录是当前工程的
node_modules。

flash和session代码顺序问题

app.use(flash()); 这句放在app.use(session(…));后面。
flash 是一个在 session 中用于存储信息的特定区域。信息写入 flash ,下一次显示完毕后即被清除。典型的应用是结合重定向的功能,确保信息是提供给下一个被渲染的页面。所以要现有session才有flash。

Error: Can't set headers after they are sent.

在密码错误时和用户不存在的情况下用return res.redirect('/login');?
不加return的话res.redirect直接跳转就报错。
Error: Can't set headers after they are sent.
登录成功的res.redirect 就不用加return?

能启动,但有两个警告express-session ...

express-session deprecated undefined resave option; provide resave option app.js:39:9
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option app.js:39:9

resave: false,//重新保存:强制会话保存即使是未修改的。(默认值ture)
saveUninitialized: true,//强制保存未初始化的会话到存储器

服务器可以起来,{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

Error: Cannot find module '../build/Release/bson'的解决办法

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

js-bson: Failed to load c++ bson extension, using pure JS version

这两行说的是没有发现bson模块。npm查看是否有bson,没有则安装:

npm install bson

然后将My-Node-blog\node_modules\mongodb\node_modules\bson\ext\index.js中的bson = require('../build/Release/bson')改成bson = require('bson') ,重新运行。如果npm ls后发现已经安装好,则直接修改require的路径。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.