Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
limbo230 opened this issue Oct 18, 2019 · 5 comments
Open

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

limbo230 opened this issue Oct 18, 2019 · 5 comments

Comments

@limbo230
Copy link

limbo230 commented Oct 18, 2019

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
Copy link
Author

This error does not happen at version 1.1.5

@tfrancois
Copy link

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

@tfrancois
Copy link

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
Copy link

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

@zblaylock
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants