javascript-obfuscator / webpack-obfuscator

javascript-obfuscator plugin for Webpack
https://github.com/javascript-obfuscator/javascript-obfuscator
BSD 2-Clause "Simplified" License
870 stars 82 forks source link

Error: Cannot find module 'javascript-obfuscator' #116

Closed mohasarc closed 3 years ago

mohasarc commented 3 years ago

I've just installed webpack-obfuscator@3.3.0, imported the module as follows.

const WebpackObfuscator = require('webpack-obfuscator');

And used it in my webpack config file as specified in the documentation; however, I am receiving the following error Error: Cannot find module 'javascript-obfuscator' when I run webpack. It probably has to do with how the module is exported because I've tried webpack-obfuscator@2.5.0, and it worked just fine (tried also all versions between 2.6.0 - 3.3.0 but did not work).

Node v. 12.18.2 webpack v. 4.43.0

sanex3339 commented 3 years ago

javascript-obfuscator is a peer dependency, so you have to install it manually.

mohasarc commented 3 years ago

That worked, thank you!

Memories-SlowFever commented 2 years ago

Meaning javascript-obfuscator needs to be specifically installed instead of webpack-obfuscator?In other words, both of these dependencies need to be installed