我正在使用ngBoilerplate作为我的应用程序的基础。 ngbp正在使用ngAnnotate和grunt-ng-annotate,注释应用程序。
一切正常,直到我不得不格式化我的电脑并从我的git帐户重新安装应用程序。
我已经使用npm install,bower install& amp; grunt安装,一切似乎都正确安装,所有依赖项都存在,所有路由都是正确的。
当我运行'grunt watch'时,构建过程正常运行。 当我运行'grunt build'时,构建过程在ngAnnotate上失败,它每次都停在不同的文件上,因此该问题与错误消息中显示的文件无关
Running "ngAnnotate:compile" (ngAnnotate) task Warning: Unable to write "build/src/app/somefile.js" file (Error code: EPERM). Use --force to continue. Aborted due to warnings.
这是ngAnnotate配置(编辑器删除了一些图表,请参阅https://gist.github.com/orzilca/f8a7312587a710094342):
ngAnnotate: { compile: { files: [ { src: [ 'app_files.js (trimmed, see the link above)' ], cwd: 'build_dir', dest: 'build_dir', expand: true } ] } },
这是app_files.js数组:
app_files: { js: [ 'src/**/*.js', '!src/**/*.spec.js', '!src/assets/**/*.js' ] }
完整的grunt文件在这里: https://gist.github.com/orzilca/f25206920943231e15fe
任何帮助将不胜感激,谢谢!
答案 0 :(得分:2)
找到了解决此问题的方法!
使用npm outdated
我发现我使用的是ng-annotate
(0.8.0)的过时版本。
更新到最新的稳定版本(0.10.0)似乎可以解决问题。
构建过程无法完美运行:)