[BUG] Regression: custom scripts not executed on dependencies from custom registry
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
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
Using npm i --foreground-scripts (or npm ci --foreground-scripts after the first install), no logs from install script are emitted for a package with a custom registry.
It does work when packages are on the main npm registry.
I've created a package to reproduce this: https://gitlab.com/Cactusbone/test-npm-scripts and I'm using @nexhome/yorkie to check normal behaviour (main registry)
Increasing verbosity in npm logs did not show anything, there's only one line with my package
npm timing reifyNode:node_modules/@cactusbone/test-npm-scripts Completed in 75ms
The expected line npm info run @cactusbone/test-npm-scripts@1.0.0 install is never produced.
Expected Behavior
Scripts from packages on a custom registry should be executed.
This is working on npm 6, but not on npm 7 and npm 8
Steps To Reproduce
- To demonstrate we'll be using https://gitlab.com/Cactusbone/test-npm-scripts package.
- With a package.json containing
"dependencies": {
"@cactusbone/test-npm-scripts": "^1.0.0"
},
- and a .npmrc file with
@cactusbone:registry=https://gitlab.com/api/v4/packages/npm/ - run
npm i --foreground-scripts - no logs are produced.
To ensure this is okay from npm registry, I also added "@nexhome/yorkie": "^2.0.8", as a dependency, and this package does produce logs upon installation.
Environment
- npm: 8.8.0
- Node.js: 16.15.0
- OS Name: Windows 11 Professionnel 21H2 22000.613
- System Model Name: custom desktop
- npm config:
; prefix = "C:\\Program Files (x86)\\Nodist\\bin" ; overridden by env
; "project" config from C:\Prod\test-npm-script-app\.npmrc
@cactusbone:registry = "https://gitlab.com/api/v4/packages/npm/"
; "env" config from environment
prefix = "C:\\Program Files (x86)\\Nodist\\bin"
; node bin location = C:\Program Files (x86)\Nodist\v-x64\16.15.0\node.exe
; node version = v16.15.0
; npm local prefix = C:\Prod\test-npm-script-app
; npm version = 8.8.0
; cwd = C:\Prod\test-npm-script-app
; HOME = C:\Users\cka
; Run `npm config ls -l` to show all defaults.
I've also tried it under WSL (ubuntu 20.04 on windows, with nvm, node v16.15.0 and npm v8.5.5), and results are the same
Work arounds:
- use npm 6 or earlier
- use git link instead of registry
It is also possible to trigger the scripts by using npm explore @cactusbone/test-npm-scripts -- npm install
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the linked @cactusbone/test-npm-scripts package, the shown package.json dependency, and the .npmrc custom registry entry. Run npm i --foreground-scripts and compare the output with the main-registry dependency and with npm 6. Done means install scripts for custom-registry packages execute and the expected npm info run line appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100