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

时间:2019-05-13 11:53:51

标签: node.js npm angular5

  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)

    emitTwo的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)

    emitTwo的13个详细堆栈(events.js:126:13)

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

    maybeClose处的13个详细堆栈(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 --prod --base /start-angular/SB-Admin-BS4-Angular-4/master/dist/",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "start:dynamic": "npm run build:dynamic && npm run serve:dynamic",
    "start:static": "npm run build:static && npm run serve:static",
    "build:client-and-server-bundles": "ng build --prod && ng build --prod --app 1 --output-hashing=false",
    "build:static": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:static",
    "build:dynamic": "npm run build:client-and-server-bundles && npm run webpack:server",
    "generate:static": "cd dist && node prerender",
    "webpack:server": "webpack --config webpack.server.config.js --progress --colors",
    "serve:static": "cd dist/browser && http-server",
    "serve:dynamic": "node dist/server"
},
"private": true,
"dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/cdk": "^5.2.3",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/material": "^5.2.3",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/platform-server": "^4.3.6",
    "@angular/router": "^5.0.0",
    "@fortawesome/angular-fontawesome": "0.1.0-9",
    "@fortawesome/fontawesome-svg-core": "^1.2.0-11",
    "@fortawesome/free-brands-svg-icons": "^5.1.0-8",
    "@fortawesome/free-solid-svg-icons": "^5.1.0-8",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.8",
    "@ng-idle/core": "^2.0.0-beta.15",
    "@ng-idle/keepalive": "^2.0.0-beta.15",
    "@nguniversal/express-engine": "^1.0.0-beta.3",
    "@nguniversal/module-map-ngfactory-loader": "^1.0.0-beta.3",
    "@ngx-cache/core": "^4.0.1",
    "@nicky-lenaers/ngx-scroll-to": "^0.6.0",
    "angular-calendar": "^0.24.1",
    "angular-fontawesome": "^1.0.0",
    "angular-star-rating": "^3.0.8",
    "angular2-csv": "0.2.5",
    "angular2-highcharts": "^0.5.5",
    "angular2-jwt": "^0.2.3",
    "angular2-moment": "^1.7.0",
    "angular2-multiselect-dropdown": "2.5.0",
    "angular2piwik": "^0.1.5-beta",
    "body-parser": "^1.18.2",
    "bootstrap": "4.0.0-beta.2",
    "calendar-utils": "^0.1.2",
    "core-js": "^2.5.1",
    "express": "^4.16.2",
    "file-saver": "^1.3.3",
    "font-awesome": "^4.7.0",
    "formdata-polyfill": "^3.0.10",
    "grapesjs": "^0.14.10",
    "grapesjs-preset-webpage": "^0.1.9",
    "highcharts": "^6.0.2",
    "howler": "^2.1.1",
    "moment": "^2.19.1",
    "moment-timezone": "^0.5.16",
    "ng-click-outside": "^3.2.0",
    "ng-recaptcha": "^3.0.5",
    "ng2-charts": "^1.6.0",
    "ng2-img-cropper": "^0.9.0",
    "ng2-pdf-viewer": "^5.2.3",
    "ngx-bootstrap": "^2.0.5",
    "ngx-ckeditor": "^0.4.0",
    "ngx-file-drop": "^2.0.2",
    "ngx-google-places-autocomplete": "^2.0.1",
    "ngx-infinite-scroll": "^0.8.2",
    "ngx-perfect-scrollbar": "^5.3.1",
    "ngx-toastr": "^6.5.0",
    "robotjs": "^0.5.1",
    "rxjs": "^5.5.2",
    "socket.io": "^2.0.4",
    "survey-angular": "^1.0.51",
    "survey-jquery": "^1.0.51",
    "surveyjs-editor": "^1.0.51",
    "xlsx": "0.12.7",
    "zone.js": "^0.8.14"
},
"devDependencies": {
    "@angular/cli": "1.5.6",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "^2.5.52",
    "@types/node": "^8.0.10",
    "codelyzer": "~4.0.1",
    "cpy-cli": "^1.0.1",
    "http-server": "^0.10.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "^4.1.0",
    "karma": "^2.0.4",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "^1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.3.2",
    "reflect-metadata": "^0.1.10",
    "ts-loader": "^2.3.7",
    "ts-node": "~3.3.0",
    "tslint": "~5.8.0",
    "typescript": "~2.4.2"
}
}

1 个答案:

答案 0 :(得分:3)

所以我在Ubuntu 18.04上安装了nvm,nodejs 8.9.3,npm 5.7.1。我遇到的第一个问题是,我无法从package.json安装软件包,而不得不使用npm i npm@latest -g将npm更新到最新版本。

下一次运行npm告诉我,那里大约有33个漏洞,其中有些很高,因此我仍然无法安装软件包。经过npm update, npm audit fix, npm audit fix --force之后,我终于可以安装软件包了。

然后我创建了一个新项目,将npx ng new projectname移到了该文件夹中并进行了npm run build。那行得通。 因此,首先我建议您更新到当前的nodejs / npm版本,然后更新软件包并尝试再次运行该版本。