【问题标题】:Error building ngx-bootstrap构建 ngx-bootstrap 时出错
【发布时间】:2018-01-18 17:45:48
【问题描述】:

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

构建说明:

第一次

克隆仓库

npm 安装

npm 运行测试

输出:

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


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


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


> ngx-bootstrap-base@2.0.0-rc.0 build.ngm C:\Git\ngx-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:\Git\ngx-bootstrap\.tmp\index.ts
[at-loader] Using typescript@2.4.2 from typescript and "tsconfig.json" from C:\Git\ngx-bootstrap\src\tsconfig.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:\Git\ngx-bootstrap\.tmp\index.ts
[at-loader] Using typescript@2.4.2 from typescript and "tsconfig.json" from C:\Git\ngx-bootstrap\src\tsconfig.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:\Git\ngx-bootstrap\.tmp [started]
[13:24:13] Cleaning C:\Git\ngx-bootstrap\.tmp [completed]
[13:24:13] Clean .tmp folders [completed]

-------------------------------------


> ngx-bootstrap-base@2.0.0-rc.0 build.sass C:\Git\ngx-bootstrap
> node-sass --recursive src --output dist --source-map true --source-map-contents sass

Rendering Complete, saving .css file...
Wrote Source Map to C:\Git\ngx-bootstrap\dist\datepicker\bs-datepicker.css.map
Wrote CSS to C:\Git\ngx-bootstrap\dist\datepicker\bs-datepicker.css
Rendering Complete, saving .css file...
Wrote Source Map to C:\Git\ngx-bootstrap\dist\datepicker\utils\scss\mixins.css.map
Wrote CSS to C:\Git\ngx-bootstrap\dist\datepicker\utils\scss\mixins.css
Rendering Complete, saving .css file...
Wrote Source Map to C:\Git\ngx-bootstrap\dist\datepicker\utils\scss\variables.css.map
Wrote CSS to C:\Git\ngx-bootstrap\dist\datepicker\utils\scss\variables.css
Wrote 3 CSS files to C:\Git\ngx-bootstrap\dist

> ngx-bootstrap-base@2.0.0-rc.0 build.es2015 C:\Git\ngx-bootstrap
> node ./scripts/es2015/bundle.es2015.js

C:\Git\ngx-bootstrap\scripts\es2015\bundle.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:\Users\paulo.larini\AppData\Roaming\npm-cache\_logs\2018-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:\Users\paulo.larini\AppData\Roaming\npm-cache\_logs\2018-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:\Users\paulo.larini\AppData\Roaming\npm-cache\_logs\2018-01-17T15_24_15_540Z-debug.log

怎么了?

【问题讨论】:

    标签: angular ngx-bootstrap


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2019-06-09
      • 2020-06-22
      • 2020-05-26
      • 2017-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-12
      • 2022-07-14
      相关资源
      最近更新 更多