npm ERR!超出最大调用堆栈大小-打字稿

时间:2019-05-09 08:09:44

标签: node.js npm npm-install

当我尝试使用npm安装typedoc来记录我的打字稿文件时,出现以下错误。我已经研究了一下,但徒劳无功。我尝试了诸如npm cache clean --force之类的解决方案,但无济于事。这是我的webpack.conf.js

const webpack = require('webpack');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

let distPath = 'dist';

module.exports = (env, argv) => {
  const create_dist_package = argv.mode === 'production';
  return {
    devtool: create_dist_package ? false : 'source-maps',
    entry: './lib/main.ts',
    mode: create_dist_package ? 'production' : 'development',
    module: {
      rules: [{
        test: /\.tsx?$/,
        use: 'ts-loader',
        exclude: /node_modules/
      }]
    },
    resolve: {
      extensions: ['.tsx', '.ts', '.js']
    },
    plugins: [
      new CleanWebpackPlugin(path.resolve(__dirname, distPath, '*.*'), {
        verbose: true
      }),
      new HtmlWebpackPlugin({
        template: 'lib/filename.html'
      })
    ],
    stats: {
      children: false
    },
    output: {
      filename: '[name].bundle.js',
      path: path.resolve(__dirname, distPath),
      library: 'libName'
    }
  };
};

**
Node version - v10.14.1 
Npm version  - v6.4.2 
Typescript   - ^3.4.2
webpack      - ^4.29.0 
webpack-cli  - ^3.3.0
**

即使没有typedoc,我也可以使用jsdoc-babel,但仍然无法安装。尚无标准解决方案。有什么办法解决吗?

0 个答案:

没有答案