javascript - angularjs ani-主题构建不起作用

标签 javascript angularjs npm gulp bower

根据给出的说明here

  1. here下载ani主题项目的zip文件并将 zip 文件内容提取到 C:\dev\angular\ani-theme-master
  2. 已安装 npm、gulp 和 Bower,以下是每个工具的版本信息。

    C:\dev\angular\ani-theme-master>gulp -v 
    [12:49:20] CLI version 3.9.1
    [12:49:20] Local version 3.9.1
    C:\dev\angular\ani-theme-master>bower -v
    1.8.0
    C:\dev\angular\ani-theme-master>npm -v
    3.10.10
    
  3. 从命令提示符将目录更改为 C:\dev\angular\ani-theme-master
  4. bower 安装
        C:\dev\angular\ani-theme-master>bower install
        bower ui-router#~0.2.13                        cached github.com/angular-ui/ui-router.git#0.2.18
        bower ui-router#~0.2.13                 validate 0.2.18 against github.com/angular-ui/ui-router.git#~0.2.13
        bower json3#^3.3.0                                  cached github.com/bestiejs/json3.git#3.3.2
        bower json3#^3.3.0                                validate 3.3.2 against github.com/bestiejs/json3.git#^3.3.0
        bower angular#^1.3.0                                cached github.com/angular/bower-angular.git#1.6.4
        bower angular#^1.3.0                         validate 1.6.4 against github.com/angular/bower-angular.git#^1.3.0
        bower es5-shim#^4.0.0                          cached github.com/es-shims/es5-shim.git#4.5.9
        bower es5-shim#^4.0.0                        validate 4.5.9 against github.com/es-shims/es5-shim.git#^4.0.0
        bower angular-mocks#~1.3.0                cached github.com/angular/bower-angular-mocks.git#1.3.20
        bower angular-mocks#~1.3.0         validate 1.3.20 against github.com/angular/bower-angular-mocks.git#~1.3.0
        bower bootstrap#^3.2.0                         cached github.com/twbs/bootstrap.git#3.3.7
        bower bootstrap#^3.2.0                  validate 3.3.7 against github.com/twbs/bootstrap.git#^3.2.0
        bower angular-animate#~1.3.15        cached github.com/angular/bower-angular-animate.git#1.3.20
        bower angular-animate#~1.3.15 validate 1.3.20 against github.com/angular/bower-angular-animate.git#~1.3.15
        bower bootstrap-btn-outline-rounded#~0.0.3                          cached github.com/sahusoftcom/bootstrap-btn-outline-rounded.git#0.0.4
        bower bootstrap-btn-outline-rounded#~0.0.3                        validate 0.0.4 against github.com/sahusoftcom/bootstrap-btn-outline-rounded.git#~0.0.3
        bower jquery#1.9.1 - 3                                                                                 cached github.com/jquery/jquery-dist.git#3.2.1
        bower jquery#1.9.1 - 3                                                                          validate 3.2.1 against github.com/jquery/jquery-dist.git#1.9.1 - 3
        bower angular#1.3.20                                                                                        cached github.com/angular/bower-angular.git#1.3.20
        bower angular#1.3.20                                                                                 validate 1.3.20 against github.com/angular/bower-angular.git#1.3.20
        bower angular                                                                                extra-resolution Unnecessary resolution: angular#1.3.14
        bower es5-shim#^4.0.0                                                                                 install es5-shim#4.5.9
        bower json3#^3.3.0                                                                                         install json3#3.3.2
        bower ui-router#~0.2.13                                                                          install ui-router#0.2.18
        bower angular#1.3.20                                                                                  install angular#1.3.20
        bower bootstrap#^3.2.0                                                                                install bootstrap#3.3.7
        bower bootstrap-btn-outline-rounded#~0.0.3                         install bootstrap-btn-outline-rounded#0.0.4
        bower angular-mocks#~1.3.0                                                                  install angular-mocks#1.3.20
        bower angular-animate#~1.3.15                                                          install angular-animate#1.3.20
        bower jquery#1.9.1 - 3                                                                                install jquery#3.2.1
        es5-shim#4.5.9 bower_components\es5-shim
        json3#3.3.2 bower_components\json3
        ui-router#0.2.18 bower_components\ui-router
        └── angular#1.3.20
        angular#1.3.20 bower_components\angular
        bootstrap#3.3.7 bower_components\bootstrap
        └── jquery#3.2.1
        bootstrap-btn-outline-rounded#0.0.4 bower_components\bootstrap-btn-outline-rounded
        angular-mocks#1.3.20 bower_components\angular-mocks
        └── angular#1.3.20
        angular-animate#1.3.20 bower_components\angular-animate
        └── angular#1.3.20
        jquery#3.2.1 bower_components\jquery
        
  5. npm install
    C:\dev\angular\ani-theme-master>npm install
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
  1. gulp build

    C:\dev\angular\ani-theme-master>gulp build
    [23:42:56] Using gulpfile ~\ani-theme-master\gulpfile.js
    (node:9516) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
    [23:42:56] Starting 'clean'...
    [23:42:56] Finished 'clean' after 99 ms
    [23:42:56] Starting 'build'...
    [23:42:56] Starting 'jshint'...
    [23:43:01] Starting 'jscs'...
    [23:43:10] Starting 'styles'...
    [23:43:26] Starting 'images'...
    [23:43:26] Starting 'fonts'...
    [23:43:28] Starting 'extras'...
    [23:43:28] Finished 'build' after 32 s
    [23:43:29] Finished 'jshint' after 33 s
    [23:43:29] Finished 'jscs' after 28 s
    [23:43:30] Finished 'images' after 3.1 s
    [23:43:37] Finished 'styles' after 27 s
    [23:43:37] Starting 'html'...
    [23:43:53] Finished 'extras' after 25 s
    events.js:160
    throw er; // Unhandled 'error' event
                    ^
    Error: styles\main.css: error: couldn't process source due to parse error
    Unexpected character '@' (1:0)
    at transform (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\index.js:20:11)
    at Transform._transform (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\index.js:68:25)
    at Transform._read (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\node_modules\readable-stream\lib\_stream_transform.js:184:10)
    at Transform._write (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\node_modules\readable-stream\lib\_stream_transform.js:172:12)
    at doWrite (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\node_modules\readable-stream\lib\_stream_writable.js:237:10)
    at writeOrBuffer (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\node_modules\readable-stream\lib\_stream_writable.js:227:5)
    at Transform.Writable.write (C:\dev\angular\ani-theme-master\node_modules\gulp-ng-annotate\node_modules\readable-stream\lib\_stream_writable.js:194:11)
    at Readable.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:96:13)
    at Readable.emit (events.js:188:7)
    

任何人都知道为什么会发生此错误,我看到 npm install 显示了一个错误,即 Unsupported platform for fsevents 32-bit vs 64-bit。我可以知道哪个工具正在寻找 64 位吗?

最佳答案

希望我的回答还不算太晚:

尝试更改 gulpfile 内 html 任务中的 if 条件,如下所示:

 .pipe($.if('**/*.js', $.ngAnnotate()))
    .pipe($.if('**/*.js', $.uglify()))
    .pipe($.if('**/*.css', cssChannel()))
    .pipe(assets.restore())
    .pipe($.useref())
    .pipe($.if('**/*.html', $.minifyHtml({conditionals: true, loose: true})))
    .pipe(gulp.dest('docs'));

关于javascript - angularjs ani-主题构建不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43563134/

相关文章:

javascript - componentDidMount 如何在执行之前等待来自 redux 存储的值(不使用 setTimeout)?

html - AngularJS:一个 index.html 中的注册和内容页面

javascript - 尝试为 Node.js 安装 npm 时出错

javascript - 将鼠标事件附加到 anchor : Javascript

javascript - onSelect事件datepicker触发timepicker中minTime值的变化

javascript - Uncaught Error : Minified exception occurred REACT and BACKBONE integration

javascript - Angular promise `all` 方法返回 `undefined`

javascript - angularjs 将 ngModel 从包装指令传递到包装指令

javascript - 创建 react 应用程序 : How do I "npm start" with a specific browser?

npm - 需要帮助理解 `npm audit` 输出中的哈希值