I am writing an Express application in TypeScript and trying to use webpack to transpile both production code and vendor modules into a single bundle.js file. But I can not do so because of a weird node-pre-gyp error :
Module not found: Error: Can't resolve 'aws-sdk' in '[...]/harema-api/node_modules/bcrypt/node_modules/node-pre-gyp/lib'
I am running node 8.11.2. Here is my webpack.config.js
:
const path = require('path'); module.exports = { entry: './src/index.ts', target: 'node', mode: 'production', devtool: 'inline-source-map', module: { rules: [ { test: /\.tsx?$/, use: 'ts-loader' } ] }, resolve: { extensions: [ '.tsx', '.ts', '.js' ] }, output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') } };
Any idea ? Thank you in advance.
bcryptjs
package instead ofbcrypt
. A little bit slower, but it works. – Oscar Saraza