Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Windows installer doesn't ensure that $USERNAME\AppData\Roaming exists #8141

@othiym23

Description

@othiym23

npm uses $APPDATA\npm so that non-Administrator roles have a writable place to stash global packages. Since creating that directory if it doesn't exist does require Administrator privileges, npm -g install <whatever> won't / can't work if the base directory doesn't exist (with the correct ACL) before npm is run. The installer should ensure that the whole path is set up at boot time.

Also, either the documentation needs to change, or maybe the installer, because right now, people trying to upgrade npm using npm after they've used the .msi frequently end up confused because npm -g install npm@latest doesn't actually upgrade them to the newest version of npm, because the first npm on their path is the one that was originally installed alongside node in the Administrator directory. Either the positions of AppData\roaming\npm and the Node binary directory need to be swapped in PATH, npm should be installed to AppData\roaming\npm in the first place, or the documentation should be clarified to tell Windows users exactly how to upgrade npm with the .msi-installed Node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions