Skip to content
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

NPM v7 breaks modules that rely on querying the user during install with an install script #3116

Closed
CalculonPrime opened this issue Apr 21, 2021 · 3 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@CalculonPrime
Copy link

CalculonPrime commented Apr 21, 2021

Running with node v14 or v15 and npm v7, I'm finding that the "install" script of the modules being installed don't run if "npm install" is run in the directory of the dependent module. This is a huge problem.

Current Behavior:

Install script doesn't run. Module's third party library is not downloaded.

Expected Behavior:

Install script runs like in npm v6, allowing user to configure and download third party library.

Steps To Reproduce:

Very simple to reproduce:

  • create a new directory and run "npm init" in it
  • in that same directory then do "npm install foo" where foo is a module with the following package.json in its "npm pack":
{
  "name": "foo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "install": "echo 'FOOBAR!!!'",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "MOBY"
}

The message "FOOBAR!!!" never appears with npm v7, whereas it does with npm v6 and node v14.

Environment:

  • OS: Windows 8.1 x64
  • Node: 14.16.1
  • npm: 7.9.0
@CalculonPrime CalculonPrime added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Apr 21, 2021
@wraithgar
Copy link
Member

This is currently being discussed in our RFC repo npm/rfcs#325

@Apollon77
Copy link

@wraithgar Are you sure it i the same? In the RFC it is only about preinstall and postinstall scripts ... We here talk about install script? If it is contained too then this is at least for me not cleasr in the rfc decription ...

... and if included then where was the rfc to "do not run install" and why it was removed because obviously it is working in npm6?

Can you please shed some light here?

@wraithgar
Copy link
Member

Yes it is part of the larger discussion around lifecycle scripts and when they run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants