项目中遇到的bug、问题总结
1. Cannot set property 'captcha' of undefined
在node项目中使用svg-captcha生成验证码报错
captcha的代码,这里有一个session.captcha,检查app.js,发现session没设置
exports.captcha = async(req, res, next) => {
  // 创建验证码
  const captcha = svgCaptcha.create()
  // 验证码文本
  req.session.captcha = captcha.text
  // 设置响应内容类型
  res.type('svg') // 使用ejs等模块时如果报错 res.type('html)
  res.status(200).send(captcha.data)
}
在app.js中加入session就可以了
const express = require('express')
const app = express()
const session = require('express-session')
app.use(session({
  secret: 'keyboard cat',
  resave: false,
  saveUninitialized: true
}))
这种错误一般是没定义属性引起的,检查一下使用的变量是否都有引入
2.Module build failed: Error: ENOENT: no such file or directory, open 'xxxxxxxxx'
切换分支后报找不到文件的错误
这种情况一般是你切换分支后你的小伙伴修改了代码提交,你切回来之后就有可能读不出修改的文件
这时候强制使用远程分支覆盖本地分支就可以了
git fetch --all
git reset --hard origin/master 这里是写你用来覆盖的分支名称,一般就是你当前所在的分支
git pull
3../node_modules/_css-loader@0.28.11@css-loader??ref--11-1!./node_modules/_postcss-loader@2.1.6@postcss-loader/lib??ref--11-2!./node_modules/_sass-loader@7.1.0@sass-loader/lib/loader.js??ref--11-3!./src/components/main/financingManagement/financing/creditFrom/from.scss Module build failed: undefined ^ Media query expression must begin with '(' in E:\Project\F2B_v3.0\src\components\main\financingManagement\financing\creditFrom\from.scss (line 3, column 3)
在项目中引入scss文件报错,
(function (exports, require, module, __filename, __dirname) { import { check, validationResult } from '_express-validator@5.3.1@express-validator/check';
在项目中引入资源错误 ,在项目中是这样写的,这样会报错
const express = require('express')
const questionCtrl = require('../controller/question.js')
const router = express.Router()
router
.get('/questions/new', questionCtrl.showNew)
module.exports = router  //router需要导出
Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled..
在node项目中打开页面报错
这是因为解析静态资源错误,检查一下静态资源的引入路径是否正确,然后重启一下项目,有时候不重启项目,这些解析资源的工作不会更改
7.
Cannot destructure property `user` of 'undefined' or 'null'
页面报错
这种是把一个对象结构赋值时报错的,原因是req.cookies没有值,
$ vue -V
bash: vue: command not found
找不到vue模块
解决: npm install -g vue
npm install -g vue-cli
npm install -g vue-cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
安装vue-cli报错
j解决: npm i -g coffeescript
npm install -g vue-cli
运行效果:
$ vue -V
2.9.6
完成!
9.
vue create vuex-api
vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.
  You may want to run the following to upgrade to Vue CLI 3:
npm uninstall -g vue-cli
  npm install -g @vue/cli
使用vue创建项目报错,create只支持vue cli 3版本,按照提示,卸载姐版本,npm uninstall -g vue-cli安装新版本 npm install -g @vue/cli
npm install -g @vue/cli
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
安装新版本vue-cli报错,
解决方法: cnpm install -g @vue/cli
重新运行
$ vue create vuex-api
?  Your connection to the default yarn registry seems to be slow.
   Use https://registry.npm.taobao.org for faster installation? (Y/n)
创建项目成功!
项目中遇到的bug、问题总结的更多相关文章
- SpringBoot项目中遇到的BUG
		1.启动项目的时候报错 1.Error starting ApplicationContext. To display the auto-configuration report re-run you ... 
- 项目中遇到的bug
		1. babel编译转换时发生了报错: BabelLoaderError: SyntaxError: Unexpected token babel预置的转换器是 babel-preset-es2015 ... 
- Maven 配置tomcat和findbug插件(在eclipse建立的项目中)
		tomcat插件 a) tomcat的maven插件可以在tomcat的官网上寻找,这就是tomcat插件的plugin b) 将tomcat的plugin配置到项目的po ... 
- Go1.13 标准库的 http 包爆出重大 bug,你的项目中招了吗? 原创: 王亚楼  Go语言中文网  今天
		Go1.13 标准库的 http 包爆出重大 bug,你的项目中招了吗? 原创: 王亚楼 Go语言中文网 今天 
- 项目中容易出现的BUG预警
		之前没有记录BUG的习惯导致在同一个坑里边栽了好几次,于是将最近几个项目中遇到的问题整理一下,在进行新项目时预警一遍: 使用携带有搜索功能的分页查询时,注意当用户更改了查询条件但没有点击查询按钮直接点 ... 
- 解决webpack项目中打包时候内存溢出的bug   JavaScript heap out of memory
		vue 项目 npm run dev 的时候一直卡住不动:后来找到报错是 Ineffective mark-compacts near heap limit Allocation failed - J ... 
- 企业应用开发模式 ERP项目中应用到的技术和工具
		一.基础技术选型 C# .NET 3.5/4.0 这两个版本的.NET已经相当方便(Linq, Lambda,Parallel),语法简洁,配合WCF和WF两项技术,可以满足快速开发,维护方便的目标 ... 
- JSPatch来更新已上线的App中出现的BUG(超级详细)
		JSPatch的作用是什么呢? 简单来说:(后面有具体的操作步骤以及在操作过程中会出现的错误) 1.iOS应用程序上架到AppStore需要等待苹果公司的审核,一般审核时间需要1到2周.虽然程序在上架 ... 
- 多War项目中静态文件的共享方案
		[原创申明:文章为原创,欢迎非盈利性转载,但转载必须注明来源] 在互联网产品中,一般会有多个项目(Jar.WAR)组成一个产品线.这些WAR项目,因为使用相同的前端架构(jQuery.easyui等) ... 
随机推荐
- .NET开源MSSQL、Redis监控产品Opserver之Redis配置
			安全与基础配置地址:http://www.cnblogs.com/xiaopotian/p/6898310.html edis监控数据实例的加载可以查看Opserver.Core项目data/Redi ... 
- SQL高性能分页
			分页的场景就不多说了,无处不在. 方法一:利用row_number() with C as ( select ROW_NUMBER() over(order by orderdate,orderid) ... 
- java中的上转型解释(多态的另一种)
			我们先来看个例子: public class Polymorphism extends BaseClass{ public String book="轻量级j2ee教程"; pub ... 
- Discuz!X2截屏控件手动安装教程-Xproer.ScreenCapture
			版权所有 2009-2015 荆门泽优软件有限公司 保留所有权利 官方网站:http://www.ncmem.com 官方博客:http://www.cnblogs.com/xproer 产品首页:h ... 
- (转)通过扩展让ASP.NET Web API支持JSONP
			原文地址:http://www.cnblogs.com/artech/p/3460544.html 同源策略(Same Origin Policy)的存在导致了“源”自A的脚本只能操作“同源”页面的D ... 
- Java 实现 WC.exe
			Github:https://github.com/YJOED/Code/tree/master/WC/src 一.题目:实现一个统计程序,它能正确统计程序文件中的字符数.单词数.行数,以及还具备其他 ... 
- CSS选择器与jQuery选择器的异同:一些特殊的选择器
			在CSS3选择器标淮草案定义的选择器语法中,jQuery支持相当完整的一套子集,同时还添加了一些非标准但很有用的伪类.下面是一些jQuery扩展的选择器:(来自http://www.cnblogs.c ... 
- dom4j学习总结(一)
			dom4j学习总结(一) (一)创建Document的基本操作 /** * xml基本操作 */ public void BaseOperation(){ //创建一个document Doc ... 
- 爬虫开发python工具包介绍 (2)
			本文来自网易云社区 作者:王涛 可选参数我们一一介绍一下: 参数 释义 示例 params 生成url中?号后面的查询Key=value 示例1: >>>payload = {'ke ... 
- 转载-----Java Longest Palindromic Substring(最长回文字符串)
			转载地址:https://www.cnblogs.com/clnchanpin/p/6880322.html 假设一个字符串从左向右写和从右向左写是一样的,这种字符串就叫做palindromic st ... 
