I tried different options to learn how it works.
package.json located in /srv/projects/awesome-project/frontend/web/
gulp located in /srv/projects/awesome-project/frontend/web/node_modules/gulp/bin/
Run npx gulp --tasks
1) on /srv/projects/awesome-project/frontend/web/
[08:38:32] Tasks for /srv/projects/awesome-project/frontend/web/gulpfile.js [08:38:32] ├── js [08:38:32] ├── css [08:38:32] └─┬ build [08:38:32] └─┬ <parallel> [08:38:32] ├── js [08:38:32] └── css
2) on /srv/projects/awesome-project/frontend
Of course it doesn't work.
[08:38:36] Local gulp not found in /srv/projects/awesome-project/frontend [08:38:36] Try running: npm install gulp
3) on /srv/projects/awesome-project/frontend/web/js
[08:38:49] Working directory changed to /srv/projects/awesome-project/frontend/web [08:38:52] Tasks for /srv/projects/awesome-project/frontend/web/gulpfile.js [08:38:52] ├── js [08:38:52] ├── css [08:38:52] └─┬ build [08:38:52] └─┬ <parallel> [08:38:52] ├── js [08:38:52] └── css
4) on /srv/projects/awesome-project/frontend/web/js/dist
[08:39:07] Working directory changed to /srv/projects/awesome-project/frontend/web [08:39:10] Tasks for /srv/projects/awesome-project/frontend/web/gulpfile.js [08:39:10] ├── js [08:39:10] ├── css [08:39:10] └─┬ build [08:39:10] └─┬ <parallel> [08:39:10] ├── js [08:39:10] └── css
Result - npx searches for the node_modules directory in the parent directories and tries to run the binary from there.
Neat
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I tried different options to learn how it works.
package.json located in /srv/projects/awesome-project/frontend/web/
gulp located in /srv/projects/awesome-project/frontend/web/node_modules/gulp/bin/
Run npx gulp --tasks
1) on /srv/projects/awesome-project/frontend/web/
2) on /srv/projects/awesome-project/frontend
Of course it doesn't work.
3) on /srv/projects/awesome-project/frontend/web/js
4) on /srv/projects/awesome-project/frontend/web/js/dist
Result - npx searches for the node_modules directory in the parent directories and tries to run the binary from there.
Neat