Comments (3)
原因是这样的:
我猜测项目作者的 vue 和 vue-template-compiler 版本已经被 package-lock.json 锁定为 2.6.*
了.
然而其他网友下载代码后, vue 和 vue-template-compiler 的版本将会是 2.7.*
甚至更高.
2.7.*
版本疑似不允许出现没有被使用的变量(或组件), 但是 2.6.*
是可以的, 所以就会出现这个问题.
解决方案①:
将 package.json 中的 vue 和 vue-template-compiler 分别从 "^2.6.10"
改成 "2.6.*"
, 就可以了.
解决方案②:
删除未使用到的组件: NumberInfo.vue 也是可以的.
以上 2 种方法实测都是有效的
@iawb-ray @chengyu2333 @leafdown
题外话:
除此之外, 你可能还需要执行一下:
npm install --save-dev mini-css-extract-plugin
如果你对nrm 和 rimraf 和 volta 有所了解的话, Windows 下, 通过以下命令也很方便的将项目 node 环境锁定为 NodeJS 12
rimraf yarn.lock package-lock.json dist node_modules && volta pin node@12 && nrm use taobao && npm install --save-dev mini-css-extract-plugin && npm install && npm run build
再推荐一篇技术文档:
聊聊NPM镜像那些险象环生的坑
from teaching-open.
感谢提供方案,已删除未使用的组件
from teaching-open.
@chengyu2333 那建议发布一下 teaching-open 2.7的版本, 因为有 vue 2.7所带来的这个问题, 会导致以前的所有 teaching-open <= 2.6 的版本, 被其他用户下载下来之后, 都出现不能正常 npm run build 的问题. 嗯, 没错, 以前的所有版本都会遇到.
from teaching-open.
Related Issues (17)
- demo 账号 HOT 1
- great. ENglish translation??? HOT 4
- 使用Python编辑器执行错误 HOT 2
- 一级菜单页面切换时会有上个页面残留 HOT 1
- webstorm里npm run build HOT 1
- 课程管理一级入口不显示 HOT 3
- transpileDependencies.map is not a function
- 设置显示课程包中每个单元的时间(上课时间) HOT 1
- 后端构建失败 HOT 1
- teaching中内嵌的scratch3.0和开源的open scratch不一样吧 HOT 1
- 最新的提交在未登陆状态下无法打开scratch3界面
- 提几个官方平台小bug HOT 1
- 三个官方平台关于用户管理和部门管理的bug HOT 1
- can not load some dependencies HOT 2
- 前端打包部署到服务器上,不显示验证码 HOT 1
- scratch3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teaching-open.