ym-project / gulp-esbuild

gulp plugin for esbuild bundler
MIT License
42 stars 7 forks source link

TypeScript example not working #8

Closed agat closed 3 years ago

agat commented 3 years ago

Hello, i have problems with latest version of this gulp plugin. And same problem with TypeScript example. All requires esbuild package.

MacOS Big Sur os. Here is output:

t0820@T0820 cn-frontend-test % cd /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/          
t0820@T0820 typescript % npm i
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 357 packages, and audited 358 packages in 7s

7 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
t0820@T0820 typescript % npm run build

> build
> gulp build

Error: Cannot find module 'esbuild'
Require stack:
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-esbuild/index.js
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/gulpfile.js
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/lib/shared/require-or-import.js
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/index.js
- /Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-esbuild/index.js:2:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-esbuild/index.js',
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/gulpfile.js',
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/lib/shared/require-or-import.js',
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp-cli/index.js',
    '/Users/t0820/Downloads/gulp-esbuild-master/examples/typescript/node_modules/gulp/bin/gulp.js'
  ]
}
t0820@T0820 typescript % node -v
v14.15.1
t0820@T0820 typescript % npm -v
7.9.0

This can be fixed, if install esbuild manually.

I have this problem after 0.6.3 version. Before this version all work fine.

ym-project commented 3 years ago

Hi! I looked at the commits connected with 0.6.3 version and was surprised. According to this commit https://github.com/ym-project/gulp-esbuild/commit/3c802fa693ae83d954d5a0e807cf6069e9a3b4a6 esbuild package was moved from dependencies to devDependencies. So npm doesn't install esbuild anymore.

And when I check examples I doesn't have problems because esbuild is installed in the root node_modules folder. And if there is no esbuild in the example folder, npm will take it from the root folder. That's why I didn't notice this problem.

I will fix it soon. Thank you for your issue!

agat commented 3 years ago

Hello. I just thought that you have a globally package.

Good day, and thank you for good gulp plugin. 👍

ym-project commented 3 years ago

I fixed this problem in 0.7.4 version. I checked examples and it works.