为了账号安全,请及时绑定邮箱和手机立即绑定

vue-admin-template 基础模板 npm run build 报错 有知道是为什么吗

/ 猿问

vue-admin-template 基础模板 npm run build 报错 有知道是为什么吗

喵喵姐 2018-10-19 16:11:02

我直接clone的github上的,没有改任何东西,安装都正常 在打包时出现了问题



> node build/build.js


(node:1304) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'search' of undefined

    at C:\Project-key\liuzhaoping\vue-admin-template\static\css\chunk-elementUI.e8091cad.css:1:155209

    at isValueCustomProp (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:106:45)

    at C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:449:18

    at mergeRules (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\lib\mergeRules.js:46:17)

    at wsc.forEach (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:438:34)

    at Array.forEach (<anonymous>)

    at Object.merge (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\lib\decl\borders.js:436:9)

    at _decl2.default.forEach.p (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\index.js:22:19)

    at Array.forEach (<anonymous>)

    at css.walkRules.rule (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\index.js:20:28)

    at C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\node_modules\postcss\lib\container.js:239:18

    at C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\node_modules\postcss\lib\container.js:135:18

    at Root.each (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\node_modules\postcss\lib\container.js:101:16)

    at Root.walk (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\node_modules\postcss\lib\container.js:131:17)

    at Root.walkRules (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\node_modules\postcss\lib\container.js:237:19)

    at css (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\postcss-merge-longhand\dist\index.js:19:13)

    at initializePlugin (C:\Project-key\liuzhaoping\vue-admin-template\node_modules\cssnano\dist\index.js:35:51)

(node:1304) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

(node:1304) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


查看完整描述

3 回答

?
qq_kaiking_g_0

把node_modules这个文件删掉,然后重新运行 cnpm i,一般都行!

查看完整回答
反对 回复 2018-10-25
?
蓓岑2015

请问楼主解决了吗?我也突然遇到这个问题,哎,无从下手。

查看完整回答
反对 回复 2018-10-25
?
聪明的汤姆

可能是依赖包没下载完整的情况,我刚刚试了一下

https://img.mukewang.com/5bc9a55100015ff508400436.jpg

使用淘宝镜像安装

npm install -g cnpm --registry=https://registry.npm.taobao.org

把node_modules文件夹全部删除,用cnpm代替npm

cnpm install
cnpm run dev
cnpm run build

测试过,有效,望采纳

查看完整回答
反对 回复 2018-10-19

添加回答

回复

举报

0/150
提交
取消
意见反馈 邀请有奖 帮助中心 APP下载
官方微信