Giter Site home page Giter Site logo

Comments (3)

yurenzhen avatar yurenzhen commented on May 30, 2024 1

原因是这样的:
我猜测项目作者的 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.

chengyu2333 avatar chengyu2333 commented on May 30, 2024

感谢提供方案,已删除未使用的组件

from teaching-open.

yurenzhen avatar yurenzhen commented on May 30, 2024

@chengyu2333 那建议发布一下 teaching-open 2.7的版本, 因为有 vue 2.7所带来的这个问题, 会导致以前的所有 teaching-open <= 2.6 的版本, 被其他用户下载下来之后, 都出现不能正常 npm run build 的问题. 嗯, 没错, 以前的所有版本都会遇到.

from teaching-open.

Related Issues (17)

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.