In general, the problem is this: a friend has published a npm module, but it is installed without dependencies.

Immediately after installation, gulp build works, but there is no gulpa in the local module (respectively).

I would like dependencies to pull up when installing the module. How to implement it?

I tried to play with the preinstall / postinstall directives - but with this approach, the installation simply loops, I think because of the life cycle of npm itself.

package.json

{ "name": "yopta", "version": "0.3.0-patch1", "description": "YoptaScript - язык программирования для гопников и реальных пацанов.", "main": "./src/core.js", "scripts": { "postinstall": "gulp build", "build": "gulp build", "dist": "gulp build", "start": "gulp watch", "test": "mocha" }, "bin": { "yopta": "./src/cli.js" }, "repository": { "type": "git", "url": "git+https://github.com/samgozman/YoptaScript" }, "keywords": [ "transpiler", "yopta", "language", "yoptascript" ], "author": "samgozman", "license": "MIT", "bugs": { "url": "https://github.com/samgozman/YoptaScript/issues" }, "homepage": "https://yopta.space/", "devDependencies": { "babel-preset-es2015": "^6.18.0", "babelify": "^7.3.0", "browserify": "^13.1.1", "chai": "^3.5.0", "gulp": "^3.9.1", "gulp-add": "0.0.2", "gulp-concat": "^2.6.1", "gulp-sourcemaps": "^1.9.1", "gulp-uglify": "^2.0.0", "mocha": "^3.2.0", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0" } } 

    1 answer 1

    The problem was that I did not fully understand how npm works. The fact is that my dependencies were declared in the directive devDependencies, and it is necessary to have dependencies. If anyone has similar problems, I hope this helps. npm, when the module is installed, extorts dependencies recursively.