我使用deploybot工具将我的角度站点从bitbucket部署到AWS S3,它过去工作得很好,但现在我已从角度2升级到角度4.1.2和angular-cli @ latest => 1.0.0
在deploybot中安装npm后,我的文件结构是
-rw-r--r-- 1 1001 999 1295 May 10 09:59 README.md
-rw-r--r-- 1 1001 1002 2770 May 27 09:35 tslint.json
-rw-r--r-- 1 1001 1002 385 May 27 09:35 tsconfig.json
drwxr-xr-x 5 1001 999 4096 May 27 09:35 src
-rw-r--r-- 1 1001 1002 756 May 27 09:35 protractor.conf.js
-rw-r--r-- 1 1001 1002 1785 May 27 09:35 package.json
-rw-r--r-- 1 1001 1002 1240 May 27 09:35 karma.conf.js
drwxr-xr-x 2 1001 999 4096 May 27 09:35 e2e
drwxrwxrwx 773 root root 20480 May 27 09:38 node_modules
我的错误:
Your global Angular CLI version (1.0.6) is greater than your local
output version (1.0.3). The local Angular CLI version is used.
output To disable this warning use "ng set --global warnings.versionMismatch=false".
output ENOENT: no such file or directory, stat '/source/src/tsconfig.json'
output Error: ENOENT: no such file or directory, stat '/source/src/tsconfig.json'
output at Error (native)
output at Object.fs.statSync (fs.js:987:18)
output at AotPlugin._setupOptions (/source/node_modules/@ngtools/webpack/src/plugin.js:58:16)
output at new AotPlugin (/source/node_modules/@ngtools/webpack/src/plugin.js:26:14)
output at _createAotPlugin (/source/node_modules/@angular/cli/models/webpack-configs/typescript.js:55:12)
output at Object.exports.getAotConfig (/source/node_modules/@angular/cli/models/webpack-configs/typescript.js:89:19)
output at NgCliWebpackConfig.buildConfig (/source/node_modules/@angular/cli/models/webpack-config.js:26:37)
output at Class.run (/source/node_modules/@angular/cli/tasks/build.js:26:92)
output at Class.run (/source/node_modules/@angular/cli/commands/build.js:143:26)
output at Class.Command.validateAndRun (/source/node_modules/@angular/cli/ember-cli/lib/models/command.js:128:15)
output at /source/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:92:22
output at tryCatch (/source/node_modules/rsvp/dist/rsvp.js:539:12)
output at invokeCallback (/source/node_modules/rsvp/dist/rsvp.js:554:13)
output at /source/node_modules/rsvp/dist/rsvp.js:629:16
output at flush (/source/node_modules/rsvp/dist/rsvp.js:2414:5)
output at _combinedTickCallback (internal/process/next_tick.js:67:7)
我明白位置/source/src/tsconfig.json不会给他所需的文件,bcoz有" tsconfig.app.json"和" tsconfig.json"在根文件夹中,即/ source
但我无法理解的是 1.为什么我的本地环境能够正确构建和服务,同样的事情不能在deploybot部署上工作 2. ng build --prod中的哪个文件/命令告诉系统在错误的路径中搜索tsconfig.json。所以我可以纠正它。