簡體   English   中英

webpack模塊節點產生錯誤EISDIR:對目錄的非法操作

[英]webpack module node produces error EISDIR: illegal operation on a directory

嘗試學習webpack,但每當我將模塊節點引入webpack.config.js時,我都會遇到此錯誤

錯誤輸出:

ERROR in ./src/main.js
Module build failed: Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    at Object.fs.readSync (fs.js:731:19)
    at tryReadSync (fs.js:486:20)
    at Object.fs.readFileSync (fs.js:534:19)
    at ConfigChainBuilder.addConfig (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:146:32)
    at ConfigChainBuilder.findConfigs (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:102:30)
    at buildConfigChain (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:61:13)
    at OptionManager.init (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/options/option-manager.js:360:58)
    at File.initOptions (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/file/index.js:139:24)
    at Pipeline.transform (/Users/noah/.Trash/02_02/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/noah/.Trash/02_02/node_modules/babel-loader/lib/index.js:41:20)
    at Object.module.exports (/Users/noah/.Trash/02_02/node_modules/babel-loader/lib/index.js:138:12)

webpack.config.js

module.exports = {
  entry: './src/main.js',
  output: {
    path: 'build',
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules)/,
        loader: 'babel'
      }
    ]
  }
};

SRC / main.js

const $ = require('jquery');

$('#target').html('hello world!');

它看起來像babel-corebabel-loader還沒有保存到我的package.json中。 DERP。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM