Angular 4可以在多脚本加载器'中构建get' ERROR。

时间:2017-08-15 01:06:27

标签: angular typescript angular-cli

当我尝试运行sudo ng build --prod --env=prod --aot=false时,构建停在92% chunk asset optimization,我收到以下错误消息:

ERROR in multi script-loader!./node_modules/jquery/dist/jquery.js script-loader!./node_modules/tether/dist/js/tether.js script-loader!./node_modules/bootstrap/dist/js/bootstrap.js script-loader!./node_modules/masonry-layout/dist/masonry.pkgd.js
Module not found: Error: Can't resolve '/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js' in '/home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/models/webpack-configs'
resolve '/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js' in '/home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/models/webpack-configs'
  using description file: /home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/package.json (relative path: ./models/webpack-configs)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/package.json (relative path: ./models/webpack-configs)
    using description file: /home/ubuntu/teller-install/App/teller-app/package.json (relative path: ./node_modules/jquery/dist/jquery.js)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js.js doesn't exist
      as directory
        /home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js doesn't exist
[/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js]
[/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js.ts]
[/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js.js]
[/home/ubuntu/teller-install/App/teller-app/node_modules/jquery/dist/jquery.js]
 @ multi script-loader!./node_modules/jquery/dist/jquery.js script-loader!./node_modules/tether/dist/js/tether.js script-loader!./node_modules/bootstrap/dist/js/bootstrap.js script-loader!./node_modules/masonry-layout/dist/masonry.pkgd.js
ERROR in multi script-loader!./node_modules/jquery/dist/jquery.js script-loader!./node_modules/tether/dist/js/tether.js script-loader!./node_modules/bootstrap/dist/js/bootstrap.js script-loader!./node_modules/masonry-layout/dist/masonry.pkgd.js
Module not found: Error: Can't resolve '/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js' in '/home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/models/webpack-configs'
resolve '/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js' in '/home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/models/webpack-configs'
  using description file: /home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/package.json (relative path: ./models/webpack-configs)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /home/ubuntu/teller-install/App/teller-app/node_modules/@angular/cli/package.json (relative path: ./models/webpack-configs)
    using description file: /home/ubuntu/teller-install/App/teller-app/package.json (relative path: ./node_modules/tether/dist/js/tether.js)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js.js doesn't exist
      as directory
        /home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js doesn't exist
[/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js]
[/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js.ts]
[/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js.js]
[/home/ubuntu/teller-install/App/teller-app/node_modules/tether/dist/js/tether.js]
 @ multi script-loader!./node_modules/jquery/dist/jquery.js script-loader!./node_modules/tether/dist/js/tether.js script-loader!./node_modules/bootstrap/dist/js/bootstrap.js script-loader!./node_modules

/masonry-layout/dist/masonry.pkgd.js

有谁知道为什么会这样?我可以在开发环境中构建一切正常但这个错误只发生在生产环境中。

由于

0 个答案:

没有答案