Sentinel Using npm run build in sentinel-dashboard failed

6pp0gazn  于 2022-10-19  发布在  其他
关注(0)|答案(3)|浏览(266)

1.运行npm install
警告
npm WARN bootstrap-switch@3.3.4 requires a peer of bootstrap@^3.1.1 but none was installed.
npm WARN sentinel-dashboard@1.0.0 No repository field.
2.运行npm run build
报错
app/scripts/services/flow_service_v1.js: line 18, col 13, 'param' is defined but never used.
app/scripts/services/flow_service_v1.js: line 95, col 29, Expected '===' and instead saw '=='.
app/scripts/services/flow_service_v1.js: line 95, col 51, Expected '===' and instead saw '=='.
app/scripts/services/flow_service_v1.js: line 96, col 70, Expected '===' and instead saw '=='.
app/scripts/services/flow_service_v1.js: line 105, col 36, Expected '===' and instead saw '=='.
app/scripts/services/flow_service_v1.js: line 109, col 36, Expected '===' and instead saw '=='.
app/scripts/services/flow_service_v1.js: line 113, col 119, Line is too long.
app/scripts/services/flow_service_v1.js: line 74, col 14, 'notNumberAtLeastZero' is defined but never used.
app/scripts/services/flow_service_v1.js: line 84, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 88, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 92, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 97, col 17, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 102, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 106, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 110, col 13, 'alert' is not defined.
app/scripts/services/flow_service_v1.js: line 114, col 13, 'alert' is not defined.

node 版本:v7.0.0
npm:版本:3.10.8

ogsagwnx

ogsagwnx1#

遇到了一样的问题,怎么解决呢?

8i9zcol2

8i9zcol22#

打印的warn、error不影响使用的,执行 npm run build 后,
运行 com.alibaba.csp.sentinel.dashboard 包下的 DashboardApplication 类,
然后访问:
http://localhost:8080/index_dev.htm 或者
http://localhost:8080/index.htm 就好。

当修改页面或者js后,点击菜单->Build->Build Module 'sentinel-dashboard',然后刷新页面就行。

用master分支刚试了没问题,步骤如上供参考。

gulpfile.js 里:

// 服务
gulp.task('serve', ['build'], function () {
  plugins.connect.server({ //启动一个服务器
    root: [app.devPath], // 服务器从哪个路径开始读取,默认从开发路径读取
    livereload: true, // 自动刷新
    port: 1234
  });
  // 打开浏览器
  setTimeout(() => {
    open('http://localhost:8080/index_dev.htm')
  }, 200);
  // 监听
  gulp.watch(app.srcPath + '**/*.js', ['js']);
  gulp.watch(app.srcPath + '**/*.css', ['css']);
});

指定的server端口是1234,如果不启动 DashboardApplication ,访问:
http://localhost:1234 能看到tmp目录下的css和js目录。

gulpfile.js 的第4行:

const app = {
  srcPath: 'app/', // 源代码
  devPath: 'tmp/', // 开发打包
  prdPath: 'dist/' // 生产打包
};
ig9co6j1

ig9co6j13#

node.js 版本 v8.11.2
npm版本 5.6.0
#npm install -g gulp@3.9.1 --no-fund
#npm install --no-fund

gulp -v

[16:45:56] CLI version 3.9.1
[16:45:56] Local version 3.9.1

npm run build

#npm start

相关问题