-
Notifications
You must be signed in to change notification settings - Fork 51
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
Not showing up in node_modules/.bin until npm rebuild #669
Comments
Whoa, this looks bad and the only thing that might be happening is the path? Checking tsc they use |
I tried that earlier, and it didn't work. Though now whenever I install the node-jq package from a local directory it does the symlink, while the npm package still isn't. So I dunno what changed. Can you replicate any of this, or is it only being weird for me and a coworker? |
Okay I think I figured it out. Demonstration: $ cd /tmp/whatever
$ git clone git@github.com:sanack/node-jq.git
$ npm i ./node-jq/
$ ls ./node_modules/.bin/node-jq
lsd: ./node_modules/.bin/node-jq: No such file or directory (os error 2).
# but install a second time, and it shows up
$ rm -rf ./node_modules/ package*
$ npm i ./node-jq/
$ ls ./node_modules/.bin/node-jq
./node_modules/.bin/node-jq@
# now delete node-jq/bin, created in postinstall
$ rm -rf node-jq/bin
$ rm -rf ./node_modules/ package*
$ npm i ./node-jq/
$ ls ./
lsd: ./node_modules/.bin/node-jq: No such file or directory (os error 2). Solution: diff --git a/package.json b/package.json
index 94a445c..47de719 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"lint": "standard --verbose | snazzy",
"build": "swc ./src --delete-dir-on-start -d lib",
"copy-ts-defintions": "copyfiles src/*.d.ts lib -f",
- "postinstall": "npm run install-binary",
+ "preinstall": "npm run install-binary",
"coverage": "nyc report --reporter=lcov",
"precodeclimate": "npm run coverage",
"codeclimate": "codeclimate-test-reporter < coverage/lcov.info", I'm not sure how to test installing it as an npm module, but I think this will work? |
That's interesting, it should work indeed. Want to push a PR so we can play with a prerelease version? |
🎉 This issue has been resolved in version 4.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
You can test the new version with the fix node-jq@4.3.1, will keep it open (was automatically closed) |
It works! |
Description
When I install
node-jq
, the symlink doesn't show up innode_modules/.bin
until I donode-rebuild
, sonpx node-jq whatever
fails.Reproduction
create new directory
Notice how
tsc
showed up the first time,node-jq
only afternpm rebuild
.If I run with
--loglevel verbose
both the install and the rebuild haveEnvironment
All testing was done with node-jq 4.3.0
Systems tested:
The bit where it gets weird
If I modify the
node-jq
package.json
bin field fromit works as expected.
So I tried making a test module with a single thing in the bin field, but it worked as expected.
So, any idea what might be happening?
I can do bug report against npm if we can figure out how to reproduce.
The text was updated successfully, but these errors were encountered: