gpt4 book ai didi

windows - .ebignore 不跳过 node_modules (Amazon)

转载 作者:可可西里 更新时间:2023-11-01 09:23:03 27 4
gpt4 key购买 nike

当我尝试运行 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首先忽略所有内容,然后包含所需的目录和文件。

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

# Ignore everything
*

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

# Ignore node_modules
node_modules

关于windows - .ebignore 不跳过 node_modules (Amazon),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43266833/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com