本地是正常的,但一上到线上就报错:
我确实是引入了相关模块:(下面这段代码是精简过的,只表达个大概)
<template>
<e-charts :options="echartsOption" :auto-resize="true"></e-charts>
</template>
<script>
import ECharts from 'vue-echarts/components/ECharts.vue'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/chart/line'
export default{
components: {
ECharts,
},
computed:{
echartsOption: function(){
return {
tooltip: {
trigger: 'axis'
},
xAxis: {
name: '时间',
data: []
},
yAxis: {
name: ''
},
series: [{
name: '',
type: 'line',
data: []
}]
}
},
},
}
</script>
以下是jenkins上的部分Console Output
...
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.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN sass-loader@3.2.3 requires a peer of node-sass@^3.4.2 but none was installed.
npm WARN vue-echarts@2.4.0 requires a peer of vue@^2.2.6 but none was installed.
....
[10.27.215.27] Executing task 'nodejs.DDist'
[10.27.215.27] Executing task 'inner_deploy'
[10.27.215.27] put: /root/.jenkins/workspace/ZDeployToOnline/Talc__master/dist.tar.gz -> ./dist.tar.gz
[10.27.215.27] run: rm -rf dist/
[10.27.215.27] run: tar -xzf dist.tar.gz
[10.27.215.27] run: mkdir -p backup/
[10.27.215.27] run: mv dist.tar.gz backup/dist.tar.gz-20170613142556
[10.27.215.27] run: ls ./ | grep ^dist.tar.gz | wc -l
[10.27.215.27] out: 11
[10.27.215.27] out:
Done.
Disconnecting from 10.27.215.27:31109... done.
Finished: SUCCESS
报错的1.c5933c.js:formatted:4958
我把node_modules文件夹整个删了,重新npm i后正常了。https://github.com/ecomfe/ech...