javascript-obfuscator / gulp-javascript-obfuscator

Gulp plugin for javascript-obfuscator package.
99 stars 38 forks source link

Error: Cannot find module 'vinyl-sourcemaps-apply' #21

Open limbo230 opened 4 years ago

limbo230 commented 4 years ago

Hi, I encountered the following error while running gulp:

Error: Cannot find module 'vinyl-sourcemaps-apply'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\jiehui\Desktop\stuff\temp\gulp obfuscate\node_m
odules\gulp-javascript-obfuscator\index.js:5:24)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

Minimal repro:

Installed "gulp-javascript-obfuscator" version is 1.1.6

Gulpfile.js:

var gulp = require('gulp');
var js_obfuscator = require('gulp-javascript-obfuscator');

gulp.task('default', function () {
  return gulp.src('index.js')
    .pipe(js_obfuscator());
});

index.js

console.log('hello world');

package.json

{
  "name": "min-repro",
  "version": "0.0.1",
  "main": "index.js",
  "dependencies": {},
  "devDependencies": {
    "gulp": "^4.0.2",
    "gulp-javascript-obfuscator": "^1.1.4"
  }
}
limbo230 commented 4 years ago

This error does not happen at version 1.1.5

tfrancois commented 4 years ago

Has anyone found a fix for this yet? I'm getting this as well with v1.1.6.

tfrancois commented 4 years ago

I feel silly. The fix was simply to install vinyl-sourcemaps-apply locally either globally or in the project as a dependency.

npm install -g vinyl-sourcemaps-apply

Happy new year!

devkhalil1337 commented 3 years ago

my solution is I removed it from node_modules\gulp-javascript-obfuscator\index.js -> vinyl-sourcemaps-apply now it is working fine.

zblaylock commented 2 years ago

Also found that this works when you add "gulp-uglify" dev dependency. It must include the "vinyl-sourcemaps-apply"