0

I restarted my MAC, after that I got Errors...

Babel has switched to Babel-core, so I uninstalled it and changed the loader in the webpack to babel-core.

now when I run npm run bundle I get these errors:

/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

Here is also the 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
};

after all these, in chrome console, the same error...Module build failed: Error: The node API for babel has been moved to babel-core.

What do you think the problem is?

Note: NPM and Node are in the latest Versions!!!

1 Answer 1

2

use babel-loader instead of babel-core

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.