构建 ngx 引导程序时出错



我克隆了ngx-bootstrap git-hub项目并按照说明进行构建,但总是出错。

构建说明:

第一次

克隆存储库

npm 安装

npm 运行测试

输出:

> ngx-bootstrap-base@2.0.0-rc.0 pretest C:Gitngx-bootstrap
> run-s lint build link

> ngx-bootstrap-base@2.0.0-rc.0 lint C:Gitngx-bootstrap
> exit 0

> ngx-bootstrap-base@2.0.0-rc.0 build C:Gitngx-bootstrap
> run-s build.ngm build.sass build.es2015

> ngx-bootstrap-base@2.0.0-rc.0 build.ngm C:Gitngx-bootstrap
> ngm build -p src --clean
[13:23:44] Clean dist folders [started]
[13:23:44] Cleaning dist [started]
[13:23:44] Cleaning dist [completed]
[13:23:44] Clean dist folders [completed]
[13:23:44] Copy *.md and license files [started]
[13:23:44] Copy *.md and license files [completed]
[13:23:44] Build package.json files [started]
[13:23:44] Build package.json files [completed]
[13:23:44] Copy source files to temporary folder [started]
[13:23:44] Copying ngx-bootstrap source files to src [started]
[13:23:45] Copying ngx-bootstrap source files to src [completed]
[13:23:45] Copy source files to temporary folder [completed]
[13:23:45] Inline template and style files into the components [started]
[13:23:45] Inlining ngx-bootstrap templates and styles [started]
[13:23:45] Inlining ngx-bootstrap templates and styles [completed]
[13:23:45] Inline template and style files into the components [completed]
[13:23:45] Build projects [started]
[13:23:45] Building ngx-bootstrap (src) [started]
[13:23:55] Building ngx-bootstrap (src) [completed]
[13:23:55] Build projects [completed]
[13:23:55] Copy assets to dist folder [started]
[13:23:55] Copy assets to dist folder [skipped]
[13:23:55] Bundling umd version [started]
[13:23:55] Bundling ngx-bootstrap [started]
 10% building modules 0/1 modules 1 active ...-0!C:Gitngx-bootstrap.tmpindex.ts
[at-loader] Using typescript@2.4.2 from typescript and "tsconfig.json" from C:Gitngx-bootstrapsrctsconfig.json.
                                     [13:24:03] Bundling ngx-bootstrap [completed]
[13:24:03] Bundling umd version [completed]
[13:24:03] Bundling minified umd version [started]
[13:24:03] Bundling ngx-bootstrap [started]
 10% building modules 0/1 modules 1 active ...-0!C:Gitngx-bootstrap.tmpindex.ts
[at-loader] Using typescript@2.4.2 from typescript and "tsconfig.json" from C:Gitngx-bootstrapsrctsconfig.json.
                                     [13:24:13] Bundling ngx-bootstrap [completed]
[13:24:13] Bundling minified umd version [completed]
[13:24:13] Clean .tmp folders [started]
[13:24:13] Cleaning C:Gitngx-bootstrap.tmp [started]
[13:24:13] Cleaning C:Gitngx-bootstrap.tmp [completed]
[13:24:13] Clean .tmp folders [completed]
-------------------------------------

> ngx-bootstrap-base@2.0.0-rc.0 build.sass C:Gitngx-bootstrap
> node-sass --recursive src --output dist --source-map true --source-map-contents sass
Rendering Complete, saving .css file...
Wrote Source Map to C:Gitngx-bootstrapdistdatepickerbs-datepicker.css.map
Wrote CSS to C:Gitngx-bootstrapdistdatepickerbs-datepicker.css
Rendering Complete, saving .css file...
Wrote Source Map to C:Gitngx-bootstrapdistdatepickerutilsscssmixins.css.map
Wrote CSS to C:Gitngx-bootstrapdistdatepickerutilsscssmixins.css
Rendering Complete, saving .css file...
Wrote Source Map to C:Gitngx-bootstrapdistdatepickerutilsscssvariables.css.map
Wrote CSS to C:Gitngx-bootstrapdistdatepickerutilsscssvariables.css
Wrote 3 CSS files to C:Gitngx-bootstrapdist
> ngx-bootstrap-base@2.0.0-rc.0 build.es2015 C:Gitngx-bootstrap
> node ./scripts/es2015/bundle.es2015.js
C:Gitngx-bootstrapscriptses2015bundle.es2015.js:12
async function createEs2015Bundle() {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-base@2.0.0-rc.0 build.es2015: `node ./scripts/es2015/bundle.es2015.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-bootstrap-base@2.0.0-rc.0 build.es2015 script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:Userspaulo.lariniAppDataRoamingnpm-cache_logs2018-01-17T15_24_15_461Z-debug.log
ERROR: "build.es2015" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-base@2.0.0-rc.0 build: `run-s build.ngm build.sass build.es2015`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-bootstrap-base@2.0.0-rc.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:Userspaulo.lariniAppDataRoamingnpm-cache_logs2018-01-17T15_24_15_497Z-debug.log
ERROR: "build" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-bootstrap-base@2.0.0-rc.0 pretest: `run-s lint build link`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-bootstrap-base@2.0.0-rc.0 pretest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:Userspaulo.lariniAppDataRoamingnpm-cache_logs2018-01-17T15_24_15_540Z-debug.log

怎么了?

也许您正在使用不支持 async/await 的 Node.JS版本,请将 Node.JS 更新为 8+

最新更新