node.js - Getting "Module not found" error -


when run angular 2 project using

npm start

i had error this. using webpack in project. webpack

const path = require('path'); const webpack = require('webpack'); const nodeexternals = require('webpack-node-externals'); module.exports = {     entry: {         server: './src/server.ts'     },     resolve: {         extensions: ['.ts', '.js']     },     target: 'node',         plugins: [     new webpack.normalmodulereplacementplugin(/\.\.\/environments\/environment/, '../environments/environment.prod')     ],     externals: [nodeexternals({         whitelist: [         /^ng2-timeout/         ]     })],     node: {         __dirname: true     },     output: {         path: path.join(__dirname, 'dist'),         filename: '[name].js'     },     module: {         rules: [         { test: /\.ts$/, loader: 'ts-loader' }         ]     } } 

while run project had error error

fixed issue removing code webpack file

 plugins: [     new webpack.normalmodulereplacementplugin(/\.\.\/environments\/environment/, '../environments/environment.prod')     ], 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -