2017-08-20 4 views
0

ich neu gestartet meine MAC, danach habe ich Fehler bekommen ...Webpack Fehler

Babel zu Babel-Kern eingeschaltet hat, so dass ich es deinstalliert und änderte den Lader im webpack babel-Kern.

wenn ich jetzt npm run bundle laufen bekomme ich diese Fehler:

/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:35 
      throw new Error("Module '" + loader.path + "' is not a loader (must have normal or pitch function)"); 
      ^

Error: Module '/Users/imac/Desktop/fakeeh/node_modules/babel-core/index.js' is not a loader (must have normal or pitch function) 
    at loadLoader (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:35:10) 
    at iteratePitchingLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:169:2) 
    at runLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:362:2) 
    at NormalModule.doBuild (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:181:3) 
    at NormalModule.build (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:274:15) 
    at Compilation.buildModule (/usr/local/lib/node_modules/webpack/lib/Compilation.js:149:10) 
    at moduleFactory.create (/usr/local/lib/node_modules/webpack/lib/Compilation.js:447:10) 
    at factory (/usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:241:5) 
    at applyPluginsAsyncWaterfall (/usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:94:13) 
    at /usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:268:11 
    at NormalModuleFactory.params.normalModuleFactory.plugin (/usr/local/lib/node_modules/webpack/lib/CompatibilityPlugin.js:52:5) 
    at NormalModuleFactory.applyPluginsAsyncWaterfall (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:272:13) 
    at resolver (/usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:69:10) 
    at process.nextTick (/usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:194:7) 
    at _combinedTickCallback (internal/process/next_tick.js:73:7) 
    at process._tickCallback (internal/process/next_tick.js:104:9) 

npm ERR! Darwin 16.6.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "bundle" 
npm ERR! node v6.11.2 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] bundle: `webpack` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] bundle script 'webpack'. 
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 fakeeh package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  webpack 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs fakeeh 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls fakeeh 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/imac/Desktop/fakeeh/npm-debug.log 

Hier ist auch die webpack config:

const path = require('path'); 


module.exports = { 
    // the entry file for the bundle 
    entry: path.join(__dirname, '/client/src/app.jsx'), 

    // the bundle file we will get in the result 
    output: { 
    path: path.join(__dirname, '/client/dist/js'), 
    filename: 'app.js', 
    }, 

    module: { 

    // apply loaders to files that meet given conditions 
    loaders: [{ 
     test: /\.jsx?$/, 
     include: path.join(__dirname, '/client/src'), 
     loader: 'babel-core', 
    }], 
    }, 

    // start Webpack in a watch mode, so Webpack will rebuild the bundle on changes 
    watch: true 
}; 

nachdem diese alle in Chromkonsole, die gleichen Fehler ... Module build failed: Error: The node API for babel has been moved to babel-core.

Was ist das Problem Ihrer Meinung nach?

Hinweis: NPM und Knoten sind in den neuesten Versionen !!!

Antwort

2

Verwenden Sie babel-loader anstelle von babel-core