语义ui的'gulp build`给出了错误' ENOENT:没有这样的文件或目录'

时间:2016-06-17 15:35:37

标签: javascript node.js gulp semantic-ui

版本:

  

gulp@3.9.1

我已安装semantic-uinpm install并在交互式设置过程中提供默认设置。

但当我从gulp build文件夹中/semantic时,我收到以下错误:

[20:52:27] Starting 'build'...
Building Semantic
[20:52:27] Starting 'build-javascript'...
Building Javascript
[20:52:27] Starting 'build-css'...
Building CSS
[20:52:27] Starting 'build-assets'...
Building assets
[20:52:28] Created: dist/components/site.js
[20:52:28] Created: dist/components/site.min.js
[20:52:28] Created: dist/components/form.js
[20:52:28] Created: dist/components/form.min.js
[20:52:28] Created: dist/components/accordion.js
[20:52:28] Created: dist/components/accordion.min.js
[20:52:28] Created: dist/components/checkbox.js
[20:52:28] Created: dist/components/dimmer.js
[20:52:28] Created: dist/components/checkbox.min.js
[20:52:28] Created: dist/components/dimmer.min.js
[20:52:28] Created: dist/components/dropdown.js
[20:52:29] Created: dist/components/embed.js
[20:52:29] Created: dist/components/dropdown.min.js
[20:52:29] Created: dist/components/reset.css
[20:52:29] Created: dist/components/reset.min.css
[20:52:29] Created: dist/components/modal.js
[20:52:29] Created: dist/components/embed.min.js
[20:52:29] Created: dist/components/modal.min.js

稍后会出现此错误

[20:52:31] Starting 'package uncompressed js'...
[20:52:31] Finished 'build-javascript' after 4.23 s
[20:52:31] Created: dist/components/container.min.css
[20:52:31] Created: dist/components/container.css
fs.js:839
  return binding.lstat(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, lstat '/Users/venkat299/code/harvest_api/harvest_server/semantic/dist/components/semantic.min.js'

3 个答案:

答案 0 :(得分:5)

导致此问题的gulp-header 1.8.3存在问题。

https://github.com/tracker1/gulp-header/issues/37

"gulp-header": "1.8.2"直接添加到package.json,您应该没问题。

从版本号中移除^(如果已经存在),它会将您推送到下一个minor版本,这会导致问题。

答案 1 :(得分:5)

对我有用的解决方案(由DaniVarga here提供)是:

npm uninstall gulp-header
npm install gulp-header@1.8.2 --save

......然后......

gulp build

答案 2 :(得分:2)

"gulp-header": "1.8.2",添加到package.json帮助吗?

请参阅https://github.com/miickel/gulp-angular-templatecache/issues/124