2016-11-14 38 views
9

Một tuần trước, nó hoạt động tốt. Bây giờ, không có bất kỳ thay đổi (giống PC và chính xác cùng một file - không khác so với repo), sau khi npm install nó không còn làm việc và đâm với lỗi sau:Webpack đột nhiên phá vỡ

[email protected]:~/workspace/work/project$ npm run build 

> [email protected] build /some_outer_path/some_path/workspace/work/project 
> rimraf dist && webpack --progress --profile --bail 

10% building modules 3/12 modules 9 active ...h-fe/node_modules/quill/dist/quill.jsModuleNotFoundError: Module not found: Error: Can't resolve 'css' in '/some_outer_path/some_path/workspace/work/project' 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/Compilation.js:232:38 
    at onDoneResolving (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:40:20) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:159:21 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:3853:9 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at iteratorCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1082:13) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:988:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:3850:13 
    at apply (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:41:25) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:76:12 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1161:9 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at iteratorCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1082:13) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:988:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1158:13 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:216:19 
    at onResolved (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:70:11) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at afterInnerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:138:10) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at Resolver.applyPluginsAsyncSeriesBailResult1 (/some_outer_path/some_path/workspace/work/project/node_modules/tapable/lib/Tapable.js:108:46) 
    at innerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:125:19) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/tapable/lib/Tapable.js:210:15 
    at /some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:39:4 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at afterInnerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:138:10) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at Resolver.applyPluginsAsyncSeriesBailResult1 (/some_outer_path/some_path/workspace/work/project/node_modules/tapable/lib/Tapable.js:108:46) 
resolve 'css' in '/some_outer_path/some_path/workspace/work/project' 
    Parsed request is a module 
    using description file: /some_outer_path/some_path/workspace/work/project/package.json (relative path: .) 
    after using description file: /some_outer_path/some_path/workspace/work/project/package.json (relative path: .) 
    resolve as module 
     /some_outer_path/some_path/workspace/work/node_modules doesn't exist or is not a directory 
     /some_outer_path/some_path/workspace/node_modules doesn't exist or is not a directory 
     /some_outer_path/some_path/node_modules doesn't exist or is not a directory 
     /some_outer_path/node_modules doesn't exist or is not a directory 
     /mnt/node_modules doesn't exist or is not a directory 
     /node_modules doesn't exist or is not a directory 
     looking for modules in /some_outer_path/some_path/workspace/work/project/node_modules 
     using description file: /some_outer_path/some_path/workspace/work/project/package.json (relative path: ./node_modules) 
     after using description file: /some_outer_path/some_path/workspace/work/project/package.json (relative path: ./node_modules) 
      using description file: /some_outer_path/some_path/workspace/work/project/package.json (relative path: ./node_modules/css) 
      as directory 
       /some_outer_path/some_path/workspace/work/project/node_modules/css doesn't exist 
      no extension 
       /some_outer_path/some_path/workspace/work/project/node_modules/css doesn't exist 
      .js 
       /some_outer_path/some_path/workspace/work/project/node_modules/css.js doesn't exist 
      .json 
       /some_outer_path/some_path/workspace/work/project/node_modules/css.json doesn't exist 

/some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/Compilation.js:197 
         _this.errors.push(err); 
     ^
TypeError: Cannot read property 'errors' of null 
    at errorAndCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/Compilation.js:197:9) 
    at errorOrWarningAndCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/Compilation.js:228:13) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/Compilation.js:232:12 
    at onDoneResolving (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:40:20) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:159:21 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:3853:9 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at iteratorCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1082:13) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:988:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:3850:13 
    at apply (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:41:25) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:76:12 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1161:9 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:484:16 
    at iteratorCallback (/some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1082:13) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:988:16 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/node_modules/async/dist/async.js:1158:13 
    at /some_outer_path/some_path/workspace/work/project/node_modules/webpack/lib/NormalModuleFactory.js:216:19 
    at onResolved (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:70:11) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at afterInnerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:138:10) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at Resolver.applyPluginsAsyncSeriesBailResult1 (/some_outer_path/some_path/workspace/work/project/node_modules/tapable/lib/Tapable.js:108:46) 
    at innerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:125:19) 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at /some_outer_path/some_path/workspace/work/project/node_modules/tapable/lib/Tapable.js:210:15 
    at /some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:39:4 
    at loggingCallbackWrapper (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19) 
    at afterInnerCallback (/some_outer_path/some_path/workspace/work/project/node_modules/enhanced-resolve/lib/Resolver.js:138:10) 

npm ERR! Linux 4.4.0-45-generic 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" 
npm ERR! node v6.8.1 
npm ERR! npm v3.10.8 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] build: `rimraf dist && webpack --progress --profile --bail` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] build script 'rimraf dist && webpack --progress --profile --bail'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the project package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  rimraf dist && webpack --progress --profile --bail 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs project 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls project 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /some_outer_path/some_path/workspace/work/project/npm-debug.log 

webpack.config.js (chủ yếu là từ hạt giống này - https://github.com/preboot/angular2-webpack/):

// Helper: root() is defined at the bottom 
var path = require('path'); 
var webpack = require('webpack'); 

// Webpack Plugins 
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin; 
var autoprefixer = require('autoprefixer'); 
var HtmlWebpackPlugin = require('html-webpack-plugin'); 
var ExtractTextPlugin = require('extract-text-webpack-plugin'); 
var CopyWebpackPlugin = require('copy-webpack-plugin'); 
var DashboardPlugin = require('webpack-dashboard/plugin'); 
var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; 

/** 
* Env 
* Get npm lifecycle event to identify the environment 
*/ 
var ENV = process.env.npm_lifecycle_event; 
var isTestWatch = ENV === 'test-watch'; 
var isTest = ENV === 'test' || isTestWatch; 
var isProd = ENV === 'build'; 

module.exports = function makeWebpackConfig() { 
    /** 
    * Config 
    * Reference: http://webpack.github.io/docs/configuration.html 
    * This is the object where all configuration gets set 
    */ 
    var config = {}; 

    /** 
    * Devtool 
    * Reference: http://webpack.github.io/docs/configuration.html#devtool 
    * Type of sourcemap to use per build type 
    */ 
    if (isProd) { 
    config.devtool = 'source-map'; 
    } 
    else if (isTest) { 
    config.devtool = 'inline-source-map'; 
    } 
    else { 
    config.devtool = 'eval-source-map'; 
    } 

    /** 
    * Entry 
    * Reference: http://webpack.github.io/docs/configuration.html#entry 
    */ 
    config.entry = isTest ? {} : { 
    'polyfills': './src/polyfills.ts', 
    'vendor': './src/vendor.ts', 
    'app': './src/main.ts' // our angular app 
    }; 

    /** 
    * Output 
    * Reference: http://webpack.github.io/docs/configuration.html#output 
    */ 
    config.output = isTest ? {} : { 
    path: root('dist'), 
    publicPath: isProd ? '/' : 'http://localhost:8080/', 
    filename: isProd ? 'js/[name].[hash].js' : 'js/[name].js', 
    chunkFilename: isProd ? '[id].[hash].chunk.js' : '[id].chunk.js' 
    }; 

    /** 
    * Resolve 
    * Reference: http://webpack.github.io/docs/configuration.html#resolve 
    */ 
    config.resolve = { 
    // only discover files that have those extensions 
    extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html'], 
    }; 

    var atlOptions = ''; 
    if (isTest && !isTestWatch) { 
    // awesome-typescript-loader needs to output inlineSourceMap for code coverage to work with source maps. 
    atlOptions = 'inlineSourceMap=true&sourceMap=false'; 
    } 

    /** 
    * Loaders 
    * Reference: http://webpack.github.io/docs/configuration.html#module-loaders 
    * List: http://webpack.github.io/docs/list-of-loaders.html 
    * This handles most of the magic responsible for converting modules 
    */ 
    config.module = { 
    rules: [ 
     // Support for .ts files. 
     { 
     test: /\.ts$/, 
     loaders: ['awesome-typescript-loader?' + atlOptions, 'angular2-template-loader', '@angularclass/hmr-loader'], 
     exclude: [isTest ? /\.(e2e)\.ts$/ : /\.(spec|e2e)\.ts$/, /node_modules\/(?!(ng2-.+))/] 
     }, 

     // copy those assets to output 
     { 
     test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)(\?v=[0-9]\.[0-9]\.[0-9])?$/, 
     loader: 'file?name=fonts/[name].[hash].[ext]?' 
     }, 

     // Support for *.json files. 
     {test: /\.json$/, loader: 'json'}, 

     // Support for CSS as raw text 
     // use 'null' loader in test mode (https://github.com/webpack/null-loader) 
     // all css in src/style will be bundled in an external css file 
     { 
     test: /\.css$/, 
     exclude: root('src', 'app'), 
     loader: isTest ? 'null' : ExtractTextPlugin.extract({ 
      fallbackLoader: 'style-loader', 
      loader: ['css', 'postcss'] 
     }) 
     }, 
     // all css required in src/app files will be merged in js files 
     {test: /\.css$/, include: root('src', 'app'), loader: 'raw!postcss'}, 

     // support for .scss files 
     // use 'null' loader in test mode (https://github.com/webpack/null-loader) 
     // all css in src/style will be bundled in an external css file 
     { 
     test: /\.(scss|sass)$/, 
     exclude: root('src', 'app'), 
     loader: isTest ? 'null' : ExtractTextPlugin.extract({ 
      fallbackLoader: 'style-loader', 
      loader: ['css', 'postcss', 'sass'] 
     }) 
     }, 
     // all css required in src/app files will be merged in js files 
     {test: /\.(scss|sass)$/, exclude: root('src', 'style'), loader: 'raw!postcss!sass'}, 

     // support for .html as raw text 
     // todo: change the loader to something that adds a hash to images 
     {test: /\.html$/, loader: 'raw', exclude: root('src', 'public')} 
    ] 
    }; 

    if (isTest && !isTestWatch) { 
    // instrument only testing sources with Istanbul, covers ts files 
    config.module.rules.push({ 
     test: /\.ts$/, 
     enforce: 'post', 
     include: path.resolve('src'), 
     loader: 'istanbul-instrumenter-loader', 
     exclude: [/\.spec\.ts$/, /\.e2e\.ts$/, /node_modules/] 
    }); 
    } 

    // if (!isTest || !isTestWatch) { 
    // // tslint support 
    // config.module.rules.push({ 
    //  test: /\.ts$/, 
    //  enforce: 'pre', 
    //  loader: 'tslint' 
    // }); 
    // } 

    /** 
    * Plugins 
    * Reference: http://webpack.github.io/docs/configuration.html#plugins 
    * List: http://webpack.github.io/docs/list-of-plugins.html 
    */ 
    config.plugins = [ 
    // Define env variables to help with builds 
    // Reference: https://webpack.github.io/docs/list-of-plugins.html#defineplugin 
    new webpack.DefinePlugin({ 
     // Environment helpers 
     'process.env': { 
     ENV: JSON.stringify(ENV) 
     } 
    }), 

    // Workaround needed for angular 2 angular/angular#11580 
    new webpack.ContextReplacementPlugin(
     // The (\\|\/) piece accounts for path separators in *nix and Windows 
     /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 
     root('./src') // location of your src 
    ), 

    // Tslint configuration for webpack 2 
    new webpack.LoaderOptionsPlugin({ 
     options: { 
     /** 
     * Apply the tslint loader as pre/postLoader 
     * Reference: https://github.com/wbuchwalter/tslint-loader 
     */ 
     tslint: { 
      emitErrors: false, 
      failOnHint: false 
     }, 
     /** 
     * Sass 
     * Reference: https://github.com/jtangelder/sass-loader 
     * Transforms .scss files to .css 
     */ 
     sassLoader: { 
      //includePaths: [path.resolve(__dirname, "node_modules/foundation-sites/scss")] 
     }, 
     /** 
     * PostCSS 
     * Reference: https://github.com/postcss/autoprefixer-core 
     * Add vendor prefixes to your css 
     */ 
     postcss: [ 
      autoprefixer({ 
      browsers: ['last 2 version'] 
      }) 
     ] 
     } 
    }) 

    // new webpack.ProvidePlugin({Quill: 'Quill'}) 
    ]; 

    if (!isTest && !isProd) { 
    config.plugins.push(new DashboardPlugin()); 
    } 

    if (!isTest && !isTestWatch) { 
    config.plugins.push(
     new ForkCheckerPlugin(), 

     // Generate common chunks if necessary 
     // Reference: https://webpack.github.io/docs/code-splitting.html 
     // Reference: https://webpack.github.io/docs/list-of-plugins.html#commonschunkplugin 
     new CommonsChunkPlugin({ 
     name: ['vendor', 'polyfills'] 
     }), 

     // Inject script and link tags into html files 
     // Reference: https://github.com/ampedandwired/html-webpack-plugin 
     new HtmlWebpackPlugin({ 
     template: './src/public/index.html', 
     chunksSortMode: 'dependency' 
     }), 

     // Extract css files 
     // Reference: https://github.com/webpack/extract-text-webpack-plugin 
     // Disabled when in test mode or not in build mode 
     new ExtractTextPlugin({filename: 'css/[name].[hash].css', disable: !isProd}) 
    ); 
    } 

    // Add build specific plugins 
    if (isProd) { 
    config.plugins.push(
     // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin 
     // Only emit files when there are no errors 
     new webpack.NoErrorsPlugin(), 

     // // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin 
     // // Dedupe modules in the output 
     // new webpack.optimize.DedupePlugin(), 

     // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin 
     // Minify all javascript, switch loaders to minimizing mode 
     new webpack.optimize.UglifyJsPlugin({sourceMap: true, mangle: {keep_fnames: true}}), 

     // Copy assets from the public folder 
     // Reference: https://github.com/kevlened/copy-webpack-plugin 
     new CopyWebpackPlugin([{ 
     from: root('src/public') 
     }]) 
    ); 
    } 

    /** 
    * Dev server configuration 
    * Reference: http://webpack.github.io/docs/configuration.html#devserver 
    * Reference: http://webpack.github.io/docs/webpack-dev-server.html 
    */ 
    config.devServer = { 
    contentBase: './src/public', 
    historyApiFallback: true, 
    quiet: true, 
    stats: 'minimal' // none (or false), errors-only, minimal, normal (or true) and verbose 
    }; 

    return config; 
}(); 

// Helper functions 
function root(args) { 
    args = Array.prototype.slice.call(arguments, 0); 
    return path.join.apply(path, [__dirname].concat(args)); 
} 

Bất kỳ ý tưởng nào có thể bị hỏng và tại sao? Làm thế nào để sửa chữa nó?

Edit1: phiên bản webpack là 2.1.0-beta.25 2.1.0-beta.26 (Edit3)

Edit2: Hạt giống không hoạt động cũng như (chỉ để được tinh thể rõ ràng - đó là làm việc tốt một tuần trước đây quá). Nó đang gặp sự cố với lỗi này:

ERROR in ./src/polyfills.ts 
Module build failed: TypeError: Can't add property fileName, object is not extensible 
    at Object.Linter (/some_outer_path/some_path/workspace/work/angular2-webpack-official/node_modules/tslint/lib/tslint.js:12:23) 

ERROR in ./src/vendor.ts 
Module build failed: TypeError: Can't add property fileName, object is not extensible 
    at Object.Linter (/some_outer_path/some_path/workspace/work/angular2-webpack-official/node_modules/tslint/lib/tslint.js:12:23) 

ERROR in ./src/main.ts 
Module build failed: TypeError: Can't add property fileName, object is not extensible 
    at Object.Linter (/some_outer_path/some_path/workspace/work/angular2-webpack-official/node_modules/tslint/lib/tslint.js:12:23) 

Nếu tôi cho phép ts-lint trong dự án của tôi thì tôi sẽ gặp lỗi tương tự. Nhưng tôi nghĩ rằng ts-lint chỉ đâm vào đầu vào sai (một cái gì đó khác trong một chuỗi đã phá vỡ nó trước đó).

Tôi khá chắc chắn rằng tôi không thay đổi nút hoặc npm. Tôi thực sự không có một đầu mối. Đây là phụ thuộc dự án:

"dependencies": { 
    "@angular/common": "2.1.0", 
    "@angular/compiler": "2.1.0", 
    "@angular/core": "2.1.0", 
    "@angular/forms": "2.1.0", 
    "@angular/http": "2.1.0", 
    "@angular/platform-browser": "2.1.0", 
    "@angular/platform-browser-dynamic": "2.1.0", 
    "@angular/router": "3.1.0", 
    "@ngrx/core": "^1.2.0", 
    "@ngrx/effects": "^2.0.0", 
    "@ngrx/router-store": "^1.2.5", 
    "@ngrx/store": "^2.2.1", 
    "@ngrx/store-devtools": "^3.2.1", 
    "angular2-google-maps": "^0.15.0", 
    "angular2-recaptcha": "^0.3.2", 
    "core-js": "^2.4.1", 
    "lodash": "^4.16.4", 
    "ng2-translate": "^3.1.3", 
    "primeng": "^1.0.0-rc.3", 
    "quill": "^1.1.3", 
    "ramda": "^0.22.1", 
    "reflect-metadata": "^0.1.3", 
    "rxjs": "5.0.0-beta.12", 
    "tsmonad": "^0.6.1", 
    "zone.js": "^0.6.21" 
    }, 
    "devDependencies": { 
    "@angularclass/hmr": "^1.0.1", 
    "@angularclass/hmr-loader": "^3.0.2", 
    "@types/core-js": "^0.9.0", 
    "@types/jasmine": "^2.2.29", 
    "@types/node": "^6.0.38", 
    "@types/protractor": "^1.5.16", 
    "@types/selenium-webdriver": "2.44.26", 
    "angular2-template-loader": "^0.4.0", 
    "autoprefixer": "^6.3.2", 
    "awesome-typescript-loader": "^2.2.4", 
    "codelyzer": "0.0.26", 
    "copy-webpack-plugin": "^3.0.0", 
    "css-loader": "^0.25.0", 
    "extract-text-webpack-plugin": "^2.0.0-beta.4", 
    "file-loader": "^0.9.0", 
    "html-loader": "^0.4.0", 
    "html-webpack-plugin": "^2.8.1", 
    "istanbul-instrumenter-loader": "^0.2.0", 
    "jasmine-core": "^2.3.4", 
    "jasmine-spec-reporter": "^2.4.0", 
    "json-loader": "^0.5.3", 
    "karma": "1.3.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "karma-coverage": "^1.0.0", 
    "karma-jasmine": "^1.0.2", 
    "karma-mocha-reporter": "^2.0.3", 
    "karma-phantomjs-launcher": "^1.0.0", 
    "karma-remap-istanbul": "0.2.1", 
    "karma-sourcemap-loader": "^0.3.7", 
    "karma-webpack": "1.8.0", 
    "node-sass": "^3.4.2", 
    "null-loader": "0.1.1", 
    "phantomjs-prebuilt": "^2.1.4", 
    "postcss-loader": "^0.13.0", 
    "protractor": "^3.1.1", 
    "raw-loader": "0.5.1", 
    "remap-istanbul": "^0.6.4", 
    "rimraf": "^2.5.1", 
    "sass-loader": "^4.0.0", 
    "shelljs": "^0.7.0", 
    "style-loader": "^0.13.0", 
    "ts-helpers": "^1.1.1", 
    "tslint": "^3.4.0", 
    "tslint-loader": "^2.1.0", 
    "typedoc": "^0.4.4", 
    "typescript": "2.0.3", 
    "url-loader": "^0.5.6", 
    "webpack": "^2.1.0-beta.25", 
    "webpack-dashboard": "^0.1.8", 
    "webpack-dev-server": "2.1.0-beta.9" 
    } 
+0

Hình như nó không thể tải một phụ thuộc. Bạn nói rằng các tập tin không thay đổi nhưng bạn chạy npm install để chắc chắn thay đổi các tập tin. Nó phàn nàn về quill.js, có lẽ bạn có thể cố gắng thiết lập phiên bản cho thư viện này một cách rõ ràng trong hai tuần trước và điều này sẽ giải quyết vấn đề – smnbbrv

+0

Bằng cách "thay đổi tệp", tôi có nghĩa là tệp và cấu hình nguồn dự án. Tôi sẽ cố gắng nhìn vào dấu vân tay, nhưng tôi không nghĩ rằng đó là vấn đề, bởi vì tôi cũng đã thử hạt giống mà không có sửa đổi và nó cũng không hoạt động: (Tôi sẽ cập nhật câu hỏi trong thời gian ngắn. – monnef

Trả lời

11

Bạn có chắc chắn rằng mình không chạy beta26? Nếu bạn chạy NPM cài đặt trong 8 giờ cuối cùng bạn có thể đã có phiên bản mới với những thay đổi phá vỡ như thế nào bộ tải được giải quyết

Run
./node_modules/.bin/webpack -v

Với beta26 hoặc cao hơn, bạn cần phải thêm "-loader" cho mọi tên bộ nạp hoặc thêm "-loader" các resolveLoader.moduleExtions

trong trường hợp bạn đang i sẽ thay đổi tập tin vào tập tin-loader loader: 'file-loader?name=fonts/[name].[hash].[ext]?

Bạn cũng có thể chọn sử dụng theo cách cũ bằng cách xác định moduleExte nsions một cách rõ ràng về đối tượng resolveLoader

resolveLoader: { 
    moduleExtensions: ['-loader'] 
} 

Tôi chỉ có vấn đề này tương tự bản thân mình

Webpack v2.1.0-beta.26 release notes

Breaking Changes:

-loader is no longer automatically added when resolving loaders

This was removed because it often lead to problems.

You can still opt-in to the old behavior with the resolveLoader.moduleExtensions configuration option.

+0

I nghĩ rằng điều này "-loader" đã được trong. Nó đã được trong tài liệu trước khi beta26 ít nhất là –

+0

Oh, bạn là đúng.Tôi có 26 không 25. Tôi sẽ xem xét những 'loader' s – monnef

+0

Sau khi thêm hậu tố cho một loạt các bộ tải (css, nguyên, tập tin, null và một số người khác) nó có vẻ là làm việc như trước :). Cảm ơn nhiều. – monnef

Các vấn đề liên quan