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

[BUG] Global install fails if prefix directory doesn't exist #2277

Closed
t1m0thyj opened this issue Dec 2, 2020 · 0 comments · Fixed by npm/arborist#201
Closed

[BUG] Global install fails if prefix directory doesn't exist #2277

t1m0thyj opened this issue Dec 2, 2020 · 0 comments · Fixed by npm/arborist#201
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@t1m0thyj
Copy link

t1m0thyj commented Dec 2, 2020

Current Behavior:

In NPM 7.x, npm install fails when both the --global and --prefix flags are set.

Expected Behavior:

Same as NPM 6.x: The prefix directory should be created if it doesn't exist and the global install should succeed.

Steps To Reproduce:

  1. Use NPM 7.x (this works fine with NPM 6.x)
  2. Run npm install typescript -g --prefix <nonExistentDir>
    • change "<nonExistentDir>" to a path that doesn't exist
    • the package name being installed doesn't matter
  3. See error ENOENT: no such file or directory, lstat '<nonExistentDir>'
  4. Create "<nonExistentDir>" manually
  5. Repeat the command from step 2
  6. Still see error ENOENT: no such file or directory, lstat '<nonExistentDir>/lib'

Environment:

  • OS: Ubuntu 18.04
  • Node: 15.3.0
  • npm: 7.0.15
@t1m0thyj t1m0thyj 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 Dec 2, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Jan 8, 2021
@darcyclarke darcyclarke added this to the OSS - Sprint 22 milestone Jan 8, 2021
@nlf nlf self-assigned this Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants