Skip to content

nodejs packages comes preinstalled with npm but we can't update the npm version #2686

@zeachco

Description

@zeachco

What problem are you trying to solve?

npm is shipped separately to allow to update npm independently but devbox seems to couple that with npm being locked with the node version selected. I didn't find a documentation on how to run nodejs@22 with [email protected] for example

running npm install --global npm fails as nix stores are immutable

Additional context on why not just using the npm version that comes with the selected node version:
package.lock differ with different npm version and it's hard to adapt devbox with other systems that don't use devbox, we would also like to use the latest npm versions given they have speed and space optimisations

What solution would you like?

would it be possible to use the

devbox add [email protected] like for other global node depependencies?

Alternatives you've considered

A work around I found is to add in devbox.json "init_hook": ["npm() { command npx -y [email protected] \"$@\"; }"]
but that's slower, hacky and too fragile to my taste

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesttriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions