-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Lost support submodules #2774
Comments
Any updates? |
Also experiencing this issue and breaks my workflow. I reverted back to 6 in the meantime. |
npm workaround - it's documented but it doesn't work
Any updates? |
`npm install` used to `git clone --recursive` the things that it builds out of GitHub; but it [doesn't do that anymore](npm/cli#2774). Unfortunately, we depend on that feature, because a submodule is how https://github.com/Level/rocksdb pulls in the Facebook code. This fixes a really absconse error message, which is a huge pain to debug BTW: ``` npm ERR! make: *** No rule to make target 'Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o', needed by 'Release/obj.target/deps/rocksdb/rocksdb.a'. Stop. ``` (That's because there's no source code under `deps/rocksdb/rocksdb`, on account of that directory being a Git submodule.) It seems... difficult to convince npm to keep its temporary files for inspection. I had to temporarily push a hacked `package.json` into the `master` branch of `epfl-si/rocksdb-node`, with an `install` script entry that reads ``` "install": "node-gyp-build || (sleep 3600; exit 1)", ``` Confusingly enough, modern `npm`s will do the right thing (i.e. pull the submodules) when one runs e.g. `npm i -g epfl-si/rocksdb-node`; but not when said `epfl-si/rocksdb-node` is a dependency in a `package.json`, as is the case here. Go figure.
Curiously enough, using the latest version of npm, (e.g.) |
@domq presumably |
@ljharb I'm not sure what you mean with “match |
@domq sorry, what i mean is, you said |
@ljharb oh, I get it now, sorry. The behavior of |
`npm install` used to `git clone --recursive` the things that it builds out of GitHub; but it [doesn't do that anymore](npm/cli#2774). Unfortunately, we depend on that feature, because a submodule is how https://github.com/Level/rocksdb pulls in the Facebook code. This fixes a really absconse error message, which is a huge pain to debug BTW: ``` npm ERR! make: *** No rule to make target 'Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o', needed by 'Release/obj.target/deps/rocksdb/rocksdb.a'. Stop. ``` (That's because there's no source code under `deps/rocksdb/rocksdb`, on account of that directory being a Git submodule.) It seems... difficult to convince npm to keep its temporary files for inspection. I had to temporarily push a hacked `package.json` into the `master` branch of `epfl-si/rocksdb-node`, with an `install` script entry that reads ``` "install": "node-gyp-build || (sleep 3600; exit 1)", ``` Confusingly enough, modern `npm`s will do the right thing (i.e. pull the submodules) when one runs e.g. `npm i -g epfl-si/rocksdb-node`; but not when said `epfl-si/rocksdb-node` is a dependency in a `package.json`, as is the case here. Go figure.
`npm install` used to `git clone --recursive` the things that it builds out of GitHub; but it [doesn't do that anymore](npm/cli#2774). Unfortunately, we depend on that feature, because a submodule is how https://github.com/Level/rocksdb pulls in the Facebook code. This fixes a really absconse error message, which is a huge pain to debug BTW: ``` npm ERR! make: *** No rule to make target 'Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o', needed by 'Release/obj.target/deps/rocksdb/rocksdb.a'. Stop. ``` (That's because there's no source code under `deps/rocksdb/rocksdb`, on account of that directory being a Git submodule.) It seems... difficult to convince npm to keep its temporary files for inspection. I had to temporarily push a hacked `package.json` into the `master` branch of `epfl-si/rocksdb-node`, with an `install` script entry that reads ``` "install": "node-gyp-build || (sleep 3600; exit 1)", ``` Confusingly enough, modern `npm`s will do the right thing (i.e. pull the submodules) when one runs e.g. `npm i -g epfl-si/rocksdb-node`; but not when said `epfl-si/rocksdb-node` is a dependency in a `package.json`, as is the case here. Go figure.
💡 Because of npm/cli#2774 , this means that we must now use version 6 of npm to rebuild (!), like so: ``` npx npm@6 install ``
`npm install` used to `git clone --recursive` the things that it builds out of GitHub; but it [doesn't do that anymore](npm/cli#2774). Unfortunately, we depend on that feature, because a submodule is how https://github.com/Level/rocksdb pulls in the Facebook code. This fixes a really absconse error message, which is a huge pain to debug BTW: ``` npm ERR! make: *** No rule to make target 'Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o', needed by 'Release/obj.target/deps/rocksdb/rocksdb.a'. Stop. ``` (That's because there's no source code under `deps/rocksdb/rocksdb`, on account of that directory being a Git submodule.) It seems... difficult to convince npm to keep its temporary files for inspection. I had to temporarily push a hacked `package.json` into the `master` branch of `epfl-si/rocksdb-node`, with an `install` script entry that reads ``` "install": "node-gyp-build || (sleep 3600; exit 1)", ``` Confusingly enough, modern `npm`s will do the right thing (i.e. pull the submodules) when one runs e.g. `npm i -g epfl-si/rocksdb-node`; but not when said `epfl-si/rocksdb-node` is a dependency in a `package.json`, as is the case here. Go figure.
💡 Because of npm/cli#2774 , this means that we must now use version 6 of npm to rebuild (!), like so: ``` npx npm@6 install ``
`npm install` used to `git clone --recursive` the things that it builds out of GitHub; but it [doesn't do that anymore](npm/cli#2774). Unfortunately, we depend on that feature, because a submodule is how https://github.com/Level/rocksdb pulls in the Facebook code. This fixes a really absconse error message, which is a huge pain to debug BTW: ``` npm ERR! make: *** No rule to make target 'Release/obj.target/rocksdb/deps/rocksdb/rocksdb/cache/cache.o', needed by 'Release/obj.target/deps/rocksdb/rocksdb.a'. Stop. ``` (That's because there's no source code under `deps/rocksdb/rocksdb`, on account of that directory being a Git submodule.) It seems... difficult to convince npm to keep its temporary files for inspection. I had to temporarily push a hacked `package.json` into the `master` branch of `epfl-si/rocksdb-node`, with an `install` script entry that reads ``` "install": "node-gyp-build || (sleep 3600; exit 1)", ``` Confusingly enough, modern `npm`s will do the right thing (i.e. pull the submodules) when one runs e.g. `npm i -g epfl-si/rocksdb-node`; but not when said `epfl-si/rocksdb-node` is a dependency in a `package.json`, as is the case here. Go figure.
Still not fixed in npm 9.6.7 |
This is both a bug and a documentation issue. I can confirm this bug (the loss of submodule/recursive cloning in dependencies) is still true in npm 10. The documentation claims submodules will be cloned, but submodules are actually not cloned anymore.
- From: https://docs.npmjs.com/cli/v10/commands/npm-install Test Results:
Implications of the bug: What to do about it?: |
fwiw, I suddenly have this need as well on two different repos - i'm using a submodule to pull in test fixtures, and having |
I added to the docs that this is just a limitation of using git packages directly here in this npm/documentation#1279 available here https://docs.npmjs.com/about-packages-and-modules |
@reggi is there no plan to add this support? (even by some kind of dev-only postinstall hook) |
@ljharb there is no plan to add this support. If someone in userland wants to make a postinstall hook that's perfectly fine! 😸 |
How would I do such a thing in userland, such that it won't affect my package's consumers? |
idk @ljharb nevermind, idk what you meant by dev-only postinstall hook |
@reggi i mean that i'd need a hook that runs when i run |
@ljharb gotcha thanks for the clarification I'm not aware of such a hook either. |
then can this be reopened, since the use case isn't currently achievable? |
@reggi the documentation at https://docs.npmjs.com/cli/v10/commands/npm-install still claims that submodules are cloned: Unfortunately the missing support for submodules makes it impossible to install certain libraries through git, for example node-argon2 which includes the argon2 library from upstream as a submodule. Please reconsider adding support for submodules. If you decide against it, please update the documentation to remove any claims of such support. |
Current Behavior:
npm version 7 (I tried both 7.0.0 and the last 7.5.6) does not download submodules.
Expected Behavior:
npm version 6.14.11 has support submodules.
Steps To Reproduce:
I created 3 repos to reproduce the problem. The first contains package.json with dependencies to install. The second contains submodule. The third contains only Readme.md
git clone https://github.com/trofim24/npm.git
npm install
If you do this on version 6.14.11 then the
node_modules/npm-bug/npm-bug-submodule
folder will exist.If you do this on version 7.5.6 then the
node_modules/npm-bug/npm-bug-submodule
folder will not exist.Environment:
The text was updated successfully, but these errors were encountered: