当我尝试运行eb create(Windows)时,出现以下错误:

ERROR: FileNotFoundError :: [WinError 3] The system cannot find the path specified: './website\\frontend\\node_modules\\gulp-sass\\node_modules\\node-sass\\node_modules\\sass-graph\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\normalize-package-data\\node_modules\\is-builtin-module\\node_modules'

我的.ebignore文件看起来像这样,并且可以在大多数文件上工作:
# Project Files
webiste/static/
env/
.idea/
node_modules/

如果运行eb create --verbose,则会得到以下输出:(成功跳过我的env文件夹后)
INFO:   -skipping: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\hosted-git-info\LICENSE
INFO:   -skipping: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\hosted-git-info\package.json
INFO:   -skipping: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\hosted-git-info\README.md
INFO:   -skipping: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\is-builtin-module\index.js
INFO:   -skipping: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\is-builtin-module\license
INFO:  +adding: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\is-builtin-module/
INFO:   +adding: ./website\frontend\node_modules\gulp-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\is-builtin-module\node_modules
INFO: Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\ebcli\core\ebrun.py", line 45, in run_app
    app.run()
  File "C:\Python34\lib\site-packages\cement\core\foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "C:\Python34\lib\site-packages\cement\core\controller.py", line 472, in _dispatch
    return func()
  File "C:\Python34\lib\site-packages\cement\core\controller.py", line 478, in _dispatch
    return func()
  File "C:\Python34\lib\site-packages\ebcli\core\abstractcontroller.py", line 60, in default
    self.do_command()
  File "C:\Python34\lib\site-packages\ebcli\controllers\create.py", line 265, in do_command
    source=source)
  File "C:\Python34\lib\site-packages\ebcli\operations\createops.py", line 75, in make_new_env
    build_config=build_config)
  File "C:\Python34\lib\site-packages\ebcli\operations\commonops.py", line 867, in create_app_version
    version_label, source_control, staged=staged)
  File "C:\Python34\lib\site-packages\ebcli\operations\commonops.py", line 1054, in _zip_up_project
    fileoperations.zip_up_project(file_path, ignore_list=ignore_files)
  File "C:\Python34\lib\site-packages\ebcli\core\fileoperations.py", line 436, in zip_up_project
    zip_up_folder('./', location, ignore_list=ignore_list)
  File "C:\Python34\lib\site-packages\ebcli\core\fileoperations.py", line 423, in zip_up_folder
    _zipdir('./', zipf, ignore_list=ignore_list)
  File "C:\Python34\lib\site-packages\ebcli\core\fileoperations.py", line 493, in _zipdir
    zipf.write(cur_file)
  File "C:\Python34\lib\zipfile.py", line 1322, in write
    st = os.stat(filename)
FileNotFoundError: [WinError 3] The system cannot find the path specified: './website\\frontend\\node_modules\\gulp-sass\\node_modules\\node-sass\\node_modules\\sass-graph\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\normalize-package-data\\node_modules\\is-builtin-module\\node_modules'

我不知道为什么即使跳过几十个node_modules文件,它突然也想开始添加。

编辑:我还尝试了所有可能的格式化方式,例如/node_modules,\node_modules,node_modules\,node_modules/**/,node_modules/等。

最佳答案

我的建议是将.ebignore设置为首先忽略的所有内容,然后忽略所需的目录和文件。

我遇到了同样的问题,但是在node_modules文件的末尾处添加了.ebignore之后,问题就解决了。

# Ignore everything
*

# Except
!bin/
!dist/
!whatever/
!Dockerrun.aws.json
!package.json

# Ignore node_modules
node_modules

09-06 05:13