小编Cha*_*ary的帖子

在角度5中创建版本时出错

  1. 我正在尝试创建一个版本并得到以下错误

    11愚蠢的生命周期Corporate-solutions@0.0.0~start:返回:代码:139信号:空

    11愚蠢的生命周期Corporate-solutions@0.0.0~start:返回:代码:139信号:空

    12个信息生命周期Corporate-solutions@0.0.0~start:无法执行启动脚本

    13详细堆栈退出状态139

    EventEmitter的13个详细堆栈。(/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)

    产生时13的详细堆栈(events.js:126:13)

    EventEmitter.emit上的13个详细堆栈(events.js:214:7)

    ChildProcess上的13个详细堆栈。(/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)

    产生时13的详细堆栈(events.js:126:13)

    ChildProcess.emit的13个详细堆栈(events.js:214:7)

    13个详细堆栈可能在mayClose(internal / child_process.js:925:16)

    Process.ChildProcess._handle.onexit上的13个详细堆栈(internal / child_process.js:209:5)

在启动服务器时有时也会出现相同的错误

  1. npm版本v5.7.1
  2. 节点版本v8.9.3
  3. 操作系统:Ubuntu 16.04 LTS

以下是我的package.json

{
"name": "corporate-solutions",
"version": "0.0.0",
"scripts": {
    "ng": "ng",
    "start": "ng serve --ec true --port 4203 --host 0.0.0.0",
    "build": "node --max_old_space_size=5300 ./node_modules/.bin/ng build --prod",
    "win-build": "node --max_old_space_size=5300 ./node_modules/@angular/cli/bin/ng build --prod",
    "build-notify": "node --max_old_space_size=5300 ./node_modules/.bin/ng build --prod && echo 'message: Build Completed' | zenity --notification --listen",
    "build-push": "node --max_old_space_size=5300 ./node_modules/.bin/ng build --prod && ./distupload.sh",
    "gitbuild": "ng build …
Run Code Online (Sandbox Code Playgroud)

node.js npm angular5

7
推荐指数
1
解决办法
405
查看次数

如何在Bookshelf js中使用groupBy?

如何在Bookshelf JS中使用groupBy ,这是我的Controller代码.

router.route('/fetchStudentAttendance')
.post(function(req, res) {
 StudentAttendance
  .query(function (qb){
    qb.where('date', '>=', req.body.date);
    qb.groupBy("students_id");
  })
.where({'class_id': req.body.class_id, 'section_id': req.body.section_id})
.fetchAll({ withRelated: [{'StudentRef':function(qb) {qb.column('id', 'first_name', 'middle_name', 'last_name')}}]})
.then(studentAttendance => {
  let content = {
    data: studentAttendance,
    success: true,
    message: 'Record Not Found',
  };
  return res.send(content);
})
.catch(error => {
  let content = {
      data: error,
      success: false,
      message: 'Error while fetching Student Attendance.',
    };
  return res.send(content);
});
Run Code Online (Sandbox Code Playgroud)

});

当我尝试"groupBy"employee_id时,它会像这样给出错误.

code:"42703"
file:"parse_relation.c"
length:110
line:"3194"
name:"error"
position:"127"
routine:"check_ungrouped_columns_walker"
severity:"ERROR"
Run Code Online (Sandbox Code Playgroud)

node.js bookshelf.js knex.js angular

6
推荐指数
1
解决办法
1206
查看次数

从Angular 5中的CkEditor上传图像

  1. 我正在使用ngx-ckeditor:角度为5的"0.4.0".
  2. 我想从CkEditor上传图像到我的Amazon S3服务器,那么我该如何添加此功能呢?
  3. 下面是我的HTML代码

    <ck-editor 
              name="html_template" 
              [(ngModel)]="mailModel.html_template" 
              [config]="ckEditorConfig">
    </ck-editor>
    
    Run Code Online (Sandbox Code Playgroud)
  4. 这是我的组件代码

    this.ckEditorConfig = {
        filebrowserUploadUrl: 'http://192.168.0.107:8000/api/crm/v1.0/crm-distribution-library-files',
        fileTools_requestHeaders: {
            'X-Requested-With': 'xhr',
            Authorization: 'Bearer ' + localStorage.getItem('access_token')
        },
        filebrowserUploadMethod: 'xhr',
        on: {
            instanceReady: function( evt ) {
                var editor = evt.editor;
                console.log('editor ===>', editor);
            },
            fileUploadRequest: function(evt) {
                console.log( 'evt ===>', evt );
            },
        },
    };
    
    Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

有了这个,我无法获取文件,也无法发送自定义标题

ckeditor angular angular5

6
推荐指数
0
解决办法
1121
查看次数

分配失败 - Angular 11 中的 JavaScript 堆内存不足,而 ng 服务

  1. 我已将 Angular 版本从 5.2 升级到 11.2
  2. 在升级 Angular 和所有库后,当我启动服务器(ng serve)时分配失败 - JavaScript 堆内存不足
  3. 它还生成 1 个包含信息的文件,但我没有得到

你能帮我解决这个问题吗?

在此处输入图片说明

在此处输入图片说明

  1. Angular 版本和细节 在此处输入图片说明

在此处输入图片说明

javascript json node.js angular angular11

6
推荐指数
2
解决办法
920
查看次数

从IONIC 3中的assets文件夹下载CSV文件

我有一个demo-file.csv文件,它在assets/csv文件夹中,所以如何从手机上下载,

这是我的HTML和组件代码.

HTML代码

<button ion-button type="button" block (click)="downloadFile('assets/csv/demo-file.csv', 'demo-file.csv')">Download Demo File</button>
Run Code Online (Sandbox Code Playgroud)

组件代码

 public downloadFile(link: any, fileName: any) {
      if (link) {
        let path = null;
        this.showWaitingLoading();
        if (this.platform.is('ios')) {
          path = this.file.documentsDirectory;
        } else {
          path = this.file.dataDirectory;
      }

      const transfer = this.transfer.create();

      transfer.download(link, path + fileName).then(entry => {
        this.dismissWaitingLoading();
        this.openFile(entry.toURL());
      }).catch(() => {
        this.dismissWaitingLoading();
        this.showToastMsg('error', "Something went wrong");
      });
     }
    }
/* ================= OPNE FILE FUNCTION ===========*/

public openFile(path: any) {
   this.fileOpener.open(path, 'application/*')
     .then(() => …
Run Code Online (Sandbox Code Playgroud)

javascript file-transfer ionic2 ionic3 angular

5
推荐指数
1
解决办法
1025
查看次数

ngx-perfect-scrollbar 中的水平滚动

  1. 我正在使用ngx-perfect-scrollbar进行滚动,垂直滚动运行良好,但水平滚动不起作用

    <perfect-scrollbar style="max-width: 100px; max-height: 200px;">
        <ul class="tab-menu">
            <li>
                <a>All</a>
            </li>
            <li>
                <a>Company</a>
            </li>
            <li>
                <a>People</a>
            </li>
            <li>
                <a>Announcement</a>
            </li>
            <li>
               <a>Event</a>
            </li>
        </ul>
    </perfect-scrollbar>
    
    Run Code Online (Sandbox Code Playgroud)

scrollbar perfect-scrollbar angular angular5

2
推荐指数
1
解决办法
4481
查看次数

如何使用PM2运行多个应用程序?

我想使用PM2运行我的angular4应用,它将运行,但是当我关闭终端时,它将停止。

  1. 在这台服务器上已经运行了一个应用程序,它可以正常运行, 但是在我的应用程序中,当我打开终端时它将运行,否则它将停止

    pm2启动server.js

我正在使用此命令运行我的应用程序,但是当我立即关闭终端时,它将停止,因此如何使用PM2永久运行此应用程序。

node.js pm2 angular

1
推荐指数
2
解决办法
6395
查看次数

如何在Angular 4或5中按数组分组?

我得到了这种类型的数组,并且我想按整个数组将其仅按一列(first_name)分组,

[
   {
     first_name: "Apurv",
     date: "2018-01-22",
     is_present: "1", 
   }
   {
     first_name: "Lucky",
     date: "2018-01-22",
     is_present: "0", 
   }
   {
     first_name: "Apurv",
     date: "2018-01-20",
     is_present: "0", 
   }
   {
     first_name: "Lucky",
     date: "2018-01-20",
     is_present: "1", 
   }
]
Run Code Online (Sandbox Code Playgroud)

所以我怎么能从“ 组件 ” 按此数组分组?

arrays angular

0
推荐指数
1
解决办法
6721
查看次数