在npm install的时候会报错,经过上网查阅资料之后,解决方法如下:

0、先升级npm版本:npm install -g npm   有可能是npm版本过低报错

1、然后清理缓存: npm cache clean --force  可能会有之前遗留代码会产生影响,所以先清理缓存

2、再执行 npm config set registry http://registry.cnpmjs.org

3、再执行 npm install

或者直接执行:

0、先升级npm版本:npm install -g npm  有可能是npm版本过低报错

1、然后清理缓存: npm cache clean --force  可能会有之前遗留代码会产生影响,所以先清理缓存

2、直接执行命令:npm install  --registry=https://registry.npm.taobao.org --loglevel=silly:

经过以上步骤完美解决了执行npm install报错的问题;

如果还是报错,可以多几次清除缓存npm cache clean --force  我清理了三次之后完美解决了。

还有一个问题就是:

在正确创建vue项目之后 执行 npm run dev时 无法自动打开新建项目的首页,

解决办法如下:

找到根目录下的config文件夹下的index.js文件

'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
dev: {

// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},

// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, //是否默认打开浏览器,默认是false,改为true即可
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,

/**
* Source Maps
*/

新建vue项目中遇到的报错信息的更多相关文章

  1. 【bcrypt】vue项目中bcrypt安装报错

    [报错] 报错时安装方法: npm install bcrypt [解决方法] npm install bcryptjs 用 bcryptjs 替换 bcrypt 即可.

  2. python中常见的报错信息

    python中常见的报错信息 在运行程序时常会遇到报错提示,报错的信息会提示是哪个方向错的,从而帮助你定位问题: 搜集了一些python最重要的内建异常类名: AttributeError:属性错误, ...

  3. Eclipse中新建WEB项目,JSP页面报错。

    在Eclipse中新建java web项目,在JSP页面的第一行提示这个错误: [The superclass "javax.servlet.http.HttpServlet" w ...

  4. 新建maven项目index.jsp文件报错处理

    最近用eclipse新建了一个maven项目,结果刚新建完成index.jsp页面就报错了,先把错误信息贴出来看看 后来就找资料,结果发现两种解决办法,希望可以帮助用得上的人! 第一种:直接在pom. ...

  5. 解决Maven项目中的无故报错的方法

    解决Eclipse+maven中的无故报错 错误: One or more constraints have not been satisfied. Deployment Assembly跟java版 ...

  6. 项目中使用mybatis报错:对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾。

    报错信息如下: Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### ...

  7. tomcat部署新的项目的时候出现报错信息: Invalid byte tag in constant pool: 15

    上面一堆tomcat启动的提示信息省略掉,下面是报错的具体信息:org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid ...

  8. python中如何通过报错信息定位问题(异常传播轨迹)

    class SelfException(Exception): pass def main(): firstMethod() def firstMethod(): secondMethod() def ...

  9. vue项目打包后运行报错400如何解决

    昨天一个Vue项目打包后,今天测试,发现无论localhost还是服务器上都运行不了,报错如下: Failed to load resource: the server responded with ...

随机推荐

  1. Chrome扩展程序——TabCopy:一键复制网页标题和网址

    Chrome扩展程序——TabCopy:一键复制网页标题和网址 - Erik_ly的博客 - CSDN博客 https://blog.csdn.net/u012318074/article/detai ...

  2. spring boot maven META-INF/MAINIFEST.MF

    unzip -p charles.jar META-INF/MANIFEST.MF https://blog.csdn.net/isea533/article/details/50278205 htt ...

  3. oracle日期格式化

    TO_CHAR(t.CAMERA_CREAT_TIME, 'YYYY-MM-DD HH24:MI:SS') as point_registerdate,TO_CHAR(t.CAMERA_MODIFY_ ...

  4. Mac系统显示隐藏文件及文件夹

    显示隐藏文件 终端 输入如下命令,回车即可: defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Fin ...

  5. 使用scrapy入门教程

    创建项目 scrapy startprogect demo 创建爬虫 scrapy genspider myDomain madomian.com 直接创建文件也可以 运行爬虫 scrapy craw ...

  6. Django基本配置与URLconf

    what's the Django python的框架主要有:Django.Flask.Tornado Django是一个开放源代码的Web应用框架,由Python写成.它的主要特点是大而全,我们需要 ...

  7. Spring中bean标签的属性和值:

    Spring中bean标签的属性和值: <bean name="user" class="com.pojo.User" init-method=" ...

  8. [LeetCode] 236. Lowest Common Ancestor of a Binary Tree_ Medium tag: DFS, Divide and conquer

    Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...

  9. 解决xp突然出现开机登录界面的问题

    对系统进行网络相关的设置后,有时会让系统开启时突然冒出登录窗口,即使我们没有对自己的系统设置开机密码,也会冒出这个,需要回车一下才会进入系统:关机时,xp特有的“关机”,“待机”,“重新启动”按钮会变 ...

  10. 使用git将项目上传到github(最简单方法)

    首先你需要一个github账号,所有还没有的话先去注册吧! https://github.com/ 我们使用git需要先安装git工具,这里给出下载地址,下载后一路直接安装即可: https://gi ...