执行 gulp 命令,命令行结果正常,但 chorme 浏览器控制台有报错提示 ???

package.json文件如下:
{
“private”: true,
“scripts”: {
“prod”: “gulp –production”,
“dev”: “gulp watch”
},
“devDependencies”: {
“bootstrap-sass”: “^3.3.7”,
“gulp”: “^3.9.1”,
“jquery”: “^3.1.0”,
“laravel-elixir”: “^6.0.0-14”,
“laravel-elixir-vue-2”: “^0.2.0”,
“laravel-elixir-webpack-official”: “^1.0.2”,
“lodash”: “^4.16.2”,
“vue”: “^2.0.1”,
“vue-resource”: “^1.0.3”
}
}
gulpfile.js文件如下:

const elixir = require(‘laravel-elixir’);
require(‘laravel-elixir-vue-2’);
elixir((mix) => {
mix.sass(‘app.scss’)
.webpack(‘app.js’);
});

运行 npm install 有如下提示:

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use ‘npm ls graceful-fs’ to find it in the tree.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global node-gyp@3.6.0 should be installed with -g
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

最后执行 gulp 结果如下:

$ gulp
[17:58:41] Using gulpfile F:\vagrant\lnmp\zt360\admin\gulpfile.js
[17:58:41] Starting 'all'…
[17:58:41] Starting 'sass'…
[17:58:48] Finished 'sass' after 6.81 s
[17:58:48] Starting 'webpack'…
[17:58:52]
[17:58:52] Finished 'webpack' after 3.89 s
[17:58:52] Finished 'all' after 11 s
[17:58:52] Starting 'default'…
┌───────────────┬───────────────────────────────┬────────────────────────────────┬────────────────────┐
│ Task │ Summary │ Source Files │ Destination │
├───────────────┼───────────────────────────────┼────────────────────────────────┼────────────────────┤
│ mix.sass() │ 1. Compiling Sass │ resources\assets\sass\app.scss │ public\css\app.css │
│ │ 2. Autoprefixing CSS │ │ │
│ │ 3. Concatenating Files │ │ │
│ │ 4. Writing Source Maps │ │ │
│ │ 5. Saving to Destination │ │ │
├───────────────┼───────────────────────────────┼────────────────────────────────┼────────────────────┤
│ mix.webpack() │ 1. Transforming ES2015 to ES5 │ resources\assets\js\app.js │ public\js\app.js │
│ │ 2. Writing Source Maps │ │ │
│ │ 3. Saving to Destination │ │ │
└───────────────┴───────────────────────────────┴────────────────────────────────┴────────────────────┘
[17:58:52] Finished 'default' after 8.38 ms

结果似乎是正确通过,但是浏览器控制台却出现如下错误提示:

vue.js?3de6:564[Vue warn]: Error compiling template:

– Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
– Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.
– Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as , as they will not be parsed.

(found in )warn @ vue.js?3de6:564compileToFunctions @ vue.js?3de6:9032Vue$3.$mount @ vue.js?3de6:9267Vue._init @ vue.js?3de6:3750Vue$3 @ vue.js?3de6:3831(anonymous function) @ app.js?8b67:18(anonymous function) @ app.js:145__webpack_require__ @ app.js:20(anonymous function) @ app.js:64(anonymous function) @ app.js:67

因为错误提示内容太多,这里将主要的错误提示内容展示出来。折磨二天,缩小范围,确定是由
elixir((mix) => {
mix.sass(‘app.scss’)
.webpack(‘app.js’);
});
这里的 .webpack(‘app.js’); 引起,但怎么解决? 没弄明白。还请指点!谢谢

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 2

问题已解决!

7年前 评论

怎么解决的,能贴一下么?

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
6年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!