一、脚手架启动项目报错“npm ERR! missing script: serve”
1、输入npm run serve,启动项目出现错误:
2、解决办法:serv 名称不对
二、报错“‘VUE-CLI-SERVICE‘ 不是内部或外部命令”
1、如果有node_modules文件夹,删除。
2、输入以下命令
npm install -g @vue/cli-service
三、报错Error: Cannot find module 'babel-preset-es2015'
执行npm run serve报错
解决方法:
1、 npm i @babel/preset-env -D
2、把“es2015” 改成 @babel/preset-env 。
四、提示:Error: Cannot find module ‘@vue/cli-plugin-babel‘
1.把node-models删除,如果没有忽略
2.重新使用npm install命令下载依赖
五、当输入npm install后,又出现错误:code 128
说明没有安装git,而且,git权限不对等问题,请结合:五、六一块解决
报错信息如下:
error Error while executing:
error X:\XXX\XXX\bin\git.EXE ls-remote -h -t git://github.com/adobe-webplatform/eve.git
error exited with error code: 128
1、第1步:安装Git,方法参考如下链接:
2、在项目文件夹,右击,选择Git Bash Here
3、输入:git config --global url."https://".insteadOf git://
git config --global url."https://".insteadOf git://
4、再执行:npm install,就成功了!
六、当输入npm install后,又出现错误:-4058
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
建议大家看一下这个作者【小清柑】的贴子,另外,请给他【点赞】和关注这位作者!
第一步: git下载与安装
- 在git官网:https://git-scm.com/download根据自己电脑系统下载对应的安装包
点击下载好的安装包安装这个软件
- 一直点击next,直到出现install,点击install,安装完成后点击finish
- 安装好后在桌面界面点击鼠标右键,会出现如下界面
5、 检查git是否安装OK
win + r 然后在弹出框中出入cdm,弹出如下界面,输入git,回车。出现以下页面说明安装成功
第二步: 环境配置
7、点击桌面上的Git Bash快捷图标,输入以下命令按回车,来配置用户名
git config --global user.name “username”
//( "username"是自己的账户名,)
输入以下命令回车,来配置邮箱
git config --global user.email “123456@qq.com”
//( "123456@qq.com"是自己的账户名,)
以上命令执行结束后
可win + r 输入cmd
在命令行窗口键入以下命令查看配置是否OK
git config --global --list
出现下图,这步就成功了
8. 生成ssh
可继续在当前命令行窗体下执行下面命令,一直回车,出现以下类似语句,找到图中圈起来的路径
ssh-keygen -t rsa
如图所示:( id_rsa.pub)留意这个文件后面会用到
9. 将ssh文件夹中的公钥( id_rsa.pub)添加到GitHub管理平台中
GitHub的个人账户的设置中找到如下界面,用我们刚才创建的账户登录到Github页面
10. 测试一下配置是否成功,在Git Bush命令框(就是刚才配置账号和邮箱的命令框)中继续输入以下命令,回车
ssh -T git@github.com
这里(下图)可能有点差异,有的不需要输入两个yes,直接是成功信息,只要你看到成功这条信息就对了
建议大家看一下这个作者【小清柑】的贴子,另外,请给他【点赞】和关注这位作者!
七、当输入npm install后,又出现错误:npm ERR! network request to https://registry.npm.taobao.org/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND your.proxy.server
npm install -g @vue/cli
>>
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND your.proxy.server
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-10-06T13_41_07_193Z-debug-0.log
1、npm config set proxy null
2、npm config set https-proxy null
3、npm config set registry http://registry.cnpmjs.org/
4、npm install --registry=https://registry.npm.taobao.org
如果还不能解决,看看是否关掉了防火墙。