gpt4 book ai didi

ember.js - 错误 : ENOENT: no such file or directory ember-cli-shims/app-shims. js

转载 作者:行者123 更新时间:2023-12-01 22:18:06 26 4
gpt4 key购买 nike

我正在尝试使用更新的包重建项目但遇到此错误:

[folatt@ArkOS-Dev genesis]$ ember build
cleaning up...
Build failed.
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with:
Error: ENOENT: no such file or directory, open '/home/folatt/workspace/arkos/genesis/tmp/source_map_concat-input_base_path-xZBOP47K.tmp/bower_components/ember-cli-shims/app-shims.js'
at Object.fs.openSync (fs.js:583:18)
at Object.fs.readFileSync (fs.js:490:33)
at SourceMap.addFile (/home/folatt/workspace/arkos/genesis/node_modules/fast-sourcemap-concat/lib/source-map.js:75:31)
at /home/folatt/workspace/arkos/genesis/node_modules/broccoli-concat/concat.js:200:16
at Array.forEach (native)
at Concat.<anonymous> (/home/folatt/workspace/arkos/genesis/node_modules/broccoli-concat/concat.js:198:24)
at /home/folatt/workspace/arkos/genesis/node_modules/fast-sourcemap-concat/lib/source-map.js:393:12
at initializePromise (/home/folatt/workspace/arkos/genesis/node_modules/rsvp/dist/rsvp.js:589:5)
at new Promise (/home/folatt/workspace/arkos/genesis/node_modules/rsvp/dist/rsvp.js:1077:31)
at SourceMap.end (/home/folatt/workspace/arkos/genesis/node_modules/fast-sourcemap-concat/lib/source-map.js:380:10)

The broccoli plugin was instantiated at:
at Concat.Plugin (/home/folatt/workspace/arkos/genesis/node_modules/broccoli-plugin/index.js:7:31)
at new Concat (/home/folatt/workspace/arkos/genesis/node_modules/broccoli-concat/concat.js:38:10)
at module.exports (/home/folatt/workspace/arkos/genesis/node_modules/broccoli-concat/index.js:26:10)
at EmberApp.concatFiles (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/broccoli/ember-app.js:392:10)
at EmberApp._concatFiles (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/broccoli/ember-app.js:405:15)
at EmberApp.javascript (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/broccoli/ember-app.js:1297:12)
at EmberApp.toArray (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/broccoli/ember-app.js:1674:10)
at EmberApp.toTree (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/broccoli/ember-app.js:1696:30)
at module.exports (/home/folatt/workspace/arkos/genesis/ember-cli-build.js:89:14)
at Class.setupBroccoliBuilder (/home/folatt/workspace/arkos/genesis/node_modules/ember-cli/lib/models/builder.js:84:19)

我试过运行 nombom 但无济于事。我还尝试了 bower install 并重新运行 ember build

[更新]

我注意到在 ember-cli/lib/broccoli/emeber-appjs 中包含以下行:

if (bowerEmberCliShims) {
emberShims = this.bowerDirectory + '/ember-cli-shims/app-shims.js';
}

这与位于 {package-root}/vendor/ember-cli-shims/app-shims.js 的文件的新位置不对应

换句话说,向上两个目录。

[更新]

根据要求,下面是我对 package.json 和 bower.json 的更改。

作为补充说明,已经有一个非常类似的项目从 emberjs 1.x 到 2.x,所以我不必真正担心如何重写其余代码。

旧的 package.json

"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"broccoli-funnel": "^0.2.8",
"ember-breadcrumbs": "0.1.9",
"ember-cli": "1.13.13",
"ember-cli-app-version": "^1.0.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-clipboard": "0.4.1",
"ember-cli-content-security-policy": "0.5.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-ember-uploader": "0.0.1",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-ic-ajax": "0.2.4",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.4",
"ember-cli-release": "0.2.8",
"ember-cli-simple-auth": "0.8.0",
"ember-cli-simple-auth-token": "0.7.3",
"ember-cli-sri": "^1.2.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.15",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-resolver": "",
"ember-websockets": "6.3.0",
"mock-socket": "6.0.4",
"semantic-ui-ember": "2.0.0-beta.0",
"websockets": "0.2.0"
},

旧的 bo​​wer.json:

"dependencies": {
"codemirror": "~5.6.0",
"ember": "1.13.11",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-data": "1.13.15",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.1.0",
"ember-resolver": "~0.1.20",
"ember-simple-auth": "0.8.0",
"ember-uploader": "0.3.2",
"fira": "~0.1.0",
"font-awesome": "~4.4.0",
"jquery": "1.11.3",
"lightbox2": "~2.8.1",
"loader.js": "ember-cli/loader.js#3.4.0",
"moment": "~2.10.6",
"qunit": "~1.20.0",
"lato": "^0.3.0",
"semantic-ui": "^2.2.4",
"urijs": "^1.18.4",
"socket.io-client": "^1.4.8"
},

新的 package.json

"devDependencies": {
"broccoli-asset-rev": "2.5.x",
"broccoli-funnel": "1.0.x",
"ember-cli": "^2.11.1",
"ember-cli-app-version": "2.0.x",
"ember-cli-autoprefixer": "0.6.x",
"ember-cli-babel": "5.2.x",
"ember-cli-content-security-policy": "0.6.x",
"ember-cli-dependency-checker": "1.3.x",
"ember-cli-htmlbars": "1.1.x",
"ember-cli-htmlbars-inline-precompile": "0.3.x",
"ember-cli-ic-ajax": "1.0.x",
"ember-cli-inject-live-reload": "1.6.x",
"ember-cli-jshint": "2.0.x",
"ember-cli-qunit": "3.1.x",
"ember-cli-release": "0.2.x",
"ember-cli-selectize": "0.5.x",
"ember-cli-sri": "2.1.x",
"ember-cli-uglify": "1.2.x",
"ember-data": "2.11.x",
"ember-export-application-global": "1.1.x",
"ember-load-initializers": "0.6.x",
"ember-resolver": "2.1.x",
"ember-simple-auth": "1.2.x",
"ember-simple-auth-token": "2.1.x",
"ember-uploader": "1.2.x",
"ember-websockets": "6.3.x",
"ember-welcome-page": "2.0.x",
"loader.js": "4.2.x",
"mock-socket": "5.0.x",
"semantic-ui-ember": "2.0.x",
"websockets": "0.2.x"
},

新的 bower.json

"dependencies": {
"codemirror": "5.24.x",
"ember": "2.11.x",
"ember-qunit-builds": "1.0.x",
"ember-qunit-notifications": "0.1.x",
"fira": "git+https://github.com/Folatt/Fira#master",
"font-awesome": "4.7.x",
"jQuery-contextMenu": "2.4.x",
"lato-font": "2.0.x",
"loader.js": "4.0.x",
"lightbox2": "git+https://github.com/Folatt/lightbox2#master",
"moment": "2.15.x",
"multiselect": "0.9.x",
"qunit": "2.1.x",
"selectize": "0.12.x",
"semantic-ui": "2.2.x",
"socket.io-client": "1.7.x",
"urijs": "1.18.x"
}

最佳答案

您正在使用最新的 ember-cli 版本 2.11.1,您可以在此处查看所有差异 https://github.com/ember-cli/ember-new-output/compare/v2.4.0...v2.11.1

如您所见,他们从 bower 中删除了以下依赖项到 package.json,因此您必须从 bower.json 中删除它

"ember": "2.11.x",
"ember-qunit-builds": "1.0.x",
"ember-qunit-notifications": "0.1.x",
"loader.js": "4.0.x",
"qunit": "2.1.x",
"ember-cli-shims": "0.1.0",
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0"

并且只需确保 package.json 中提到的以下依赖项

"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^2.4.1",
"ember-cli": "2.11.0",
"ember-cli-app-version": "^2.0.0",
"ember-cli-babel": "^5.1.7",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-jshint": "^2.0.1",
"ember-cli-qunit": "^3.0.1",
"ember-cli-release": "^0.2.9",
"ember-cli-shims": "^1.0.2",
"ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-data": "^2.11.0",
"ember-export-application-global": "^1.0.5",
"ember-load-initializers": "^0.6.0",
"ember-resolver": "^2.0.3",
"ember-source": "^2.11.0",
"ember-welcome-page": "^2.0.2", //this is not required.
"loader.js": "^4.0.10"

为了 future upgrading ember-cli ,考虑以下步骤,

1.rm -rf node_modules bower_components dist tmp -- 删除临时开发文件夹。

2.npm install --save-dev ember-cli@2.12.0-beta.2 -- 更新项目的 package.json 以使用最新版本。

3.npm install -- 重新安装 NPM 依赖项。

4.bower install -- 重新安装 bower 依赖项。

5.ember init -- 这会在您的项目目录中运行新的项目蓝图。请按照提示查看所有更改(提示:您可以按 d 键查看差异)。升级痛苦的最常见来源是缺少此步骤中的更改。

关于ember.js - 错误 : ENOENT: no such file or directory ember-cli-shims/app-shims. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42746478/

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