Closed darcyrush closed 2 years ago
I'm seeing this as well for both npm 6.14.13 and 7.13.0.
My package.json looks like:
{
"name": "@codeshift/cli",
"version": "0.2.1",
"main": "dist/codeshift-cli.cjs.js",
"bin": {
"@codeshift/cli": "./bin/codeshift-cli.js",
"codeshift-cli": "./bin/codeshift-cli.js"
},
}
Also broken with shorthand config
{
"name": "@codeshift/cli",
"version": "0.2.1",
"main": "dist/codeshift-cli.cjs.js",
"bin": "./bin/codeshift-cli.js",
}
What about npm 7.24?
What about npm 7.24?
The same behavior npm v7.24.1 node v16.5.0 macOS Big Sur, 11.6
It seems that this is not npm issue, but Gitlab https://gitlab.com/gitlab-org/gitlab/-/issues/275992
If someone else can confirm this only affects gitlab, then the issue can be closed
{ "name": "@codeshift/cli", "version": "0.2.1", "main": "dist/codeshift-cli.cjs.js", "bin": "./bin/codeshift-cli.js", }
This seems to be the same as #4308 I'm going to close this to focus the conversation there, since I started some debugging there already. Thanks you all!
Is there an existing issue for this?
Current Behavior
Somewhere between npm 6.14.13 and 7.13.0,
npm install
no longer installs bins from scoped packages intonode_modules/.bin/
. As such, npx fails to runmy-bin-name
and instead trys to download the bin name from the public npmjs registry. Occurs on the latest version of npm 7.24.1 too.I imagine however I have just missed some change in the documentation but I don't see anything in particular in the scope or bin sections..
Note I am using a private package on a private gitlab npm repository but I don't think that is related. I don't know any public packages with a scope and bin commands to test.
The bin property is also missing on the dependency in the package-lock.json file with
lockfileVersion: 2
Expected Behavior
The bin file should appear in
node_modules/.bin/my-bin-name
and the local applicationpackage-lock.json
usinglockfileVersion: 2
should contain thebin
property in the dependency json.npx my-bin-name
should succeed without triggering an erroneous download attempt.Steps To Reproduce
Use a node install manager (like
n
) to change between node and npm versions. i.e.Environment