Angular Universal starter构建错误

时间:2016-11-21 17:31:12

标签: javascript node.js angular gulp angular-universal

克隆存储库https://github.com/angular/universal-starter.git并运行npm install,成功下载了依赖项。但是,使用npm start启动项目会导致以下错误:

    [0] Hash: 85bf4f395734d9bd880ccd42ebf013da158a27f7                                    r Version: webpack 2.1.0-beta.27
Child
    Hash: 85bf4f395734d9bd880c
    Version: webpack 2.1.0-beta.27
    Time: 17667ms
                 Asset     Size  Chunks             Chunk Names
        main.bundle.js  2.82 MB       0  [emitted]  main
    main.bundle.js.map  2.74 MB       0  [emitted]  main
     [277] ./src async 160 bytes {0} [built]
        + 436 hidden modules

    ERROR in ./~/angular2-universal-polyfills/browser.js
    Module not found: Error: Can't resolve 'es6-promise' in '/Users/yaroslavsalmin/Documents/angular universal/universal-starter/node_modules/angular2-universal-polyfills'
     @ ./~/angular2-universal-polyfills/browser.js 2:0-22
     @ ./src/client.ts

    ERROR in ./~/angular2-universal-polyfills/browser.js
    Module not found: Error: Can't resolve 'es6-shim' in '/Users/yaroslavsalmin/Documents/angular universal/universal-starter/node_modules/angular2-universal-polyfills'
     @ ./~/angular2-universal-polyfills/browser.js 3:0-19
     @ ./src/client.ts

    ERROR in ./~/angular2-universal-polyfills/browser.js
    Module not found: Error: Can't resolve 'ie-shim' in '/Users/yaroslavsalmin/Documents/angular universal/universal-starter/node_modules/angular2-universal-polyfills'
     @ ./~/angular2-universal-polyfills/browser.js 4:0-18
     @ ./src/client.ts
Child
    Hash: cd42ebf013da158a27f7
    Version: webpack 2.1.0-beta.27
    Time: 17641ms
           Asset     Size  Chunks             Chunk Names
        index.js  2.67 MB       0  [emitted]  main
    index.js.map  2.58 MB       0  [emitted]  main
     [259] ./src async 160 bytes {0} [built]
        + 419 hidden modules

我需要做些什么才能解决错误?

1 个答案:

答案 0 :(得分:0)

感谢attomos我设法从webpack获得了更详细的错误,这表明有些npm包丢失了。安装批量依赖项时,npm是正常的。重新安装了所需的软件包,并且应用程序没有问题。