-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
A preinstall script using npx
fails when master command npm install --package-lock-only
is fired.
It works when master command is npm install
Behaviors differs between npm 6.x & npm 8.x but none are correct.
Expected Behavior
npm install --package-lock-only
shoud be successfull and should execute correctly the presinstall script.
Steps To Reproduce
mkdir reproducer && cd reproducer
nvm use 16
- at the time of filling bug it installs :
node v16.14.0 (npm v8.3.1)
- at the time of filling bug it installs :
rm -rf ~/.npm/_npx
using a clean npx cache- using the following package
cat <<EOF > package.json
{
"name": "issue-only-allow-npx-package-lock-only",
"version": "1.0.0",
"description": "'npm install' works, 'npm install --package-lock-only' fails",
"scripts": {
"preinstall": "npm_config_yes=true npx only-allow npm"
}
}
EOF
npm install --package-lock-only
fails
npm install --package-lock-only
> [email protected] preinstall
> npm_config_yes=true npx only-allow npm
sh: 1: only-allow: not found
npm ERR! code 127
npm ERR! path /home/m.brouillard/projects/lectra/ui/issue-only-allow-npx-only-allow
npm ERR! command failed
npm ERR! command sh -c npm_config_yes=true npx only-allow npm
npm ERR! A complete log of this run can be found in:
npm ERR! /home/m.brouillard/.npm/_logs/2022-03-22T08_24_16_404Z-debug-0.log
Environment
- npm: 8.3.1
- Node.js: 16.14
- OS Name: Ubuntu 18.04
- System Model Name: HP Probook
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release