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 |
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: