volta-cli / volta

Volta: JS Toolchains as Code. ⚡
https://volta.sh
Other
11.15k stars 238 forks source link

Volta/Nuxt problems between multiple user accounts? #1730

Open MorningstarPhoenix opened 7 months ago

MorningstarPhoenix commented 7 months ago

This is probably a consequence of my lack of knowledge but, on my Windows machine I have two profiles (one work and one personal). I use Volta to manage my node. Nuxt projects build and run correctly in my work profile, but the same projects fail in my personal profile. The various paths relating to Volta are these:

The only difference I can spot between the personal and work profile is that I use node 18 in the work profile, and node 20 in the personal profile.

Either way, on the personal profile Nuxt seems to be looking for Devtools in C:/Program Files/nodejs/node_modules/@nuxt/devtools/module.cjs but C:/Program Files/nodejs does not exist, generating the "Cannot find module" error.

I have not validated this problem with other frameworks/projects outside Nuxt.

Anyone has any idea about what's going on?

charlespierce commented 7 months ago

Hi @MorningstarPhoenix, that's surprising! I don't have any insights into what Nuxt is doing internally, but if it works in one profile it should work in the other. What is the output of volta list all for the two profiles? It's possible that the Nuxt devtools are installed for one and not the other, which is causing it to fall back to searching the "default" locations for Node.

MorningstarPhoenix commented 7 months ago

Hi! Nuxt Devtools is not installed in neither profile... I have tried installing in the personal profile, but no dice.

Either way, running the command in the personal profile gives this output:

 User toolchain:

    Node runtimes:
        v20.9.0 (default)

    Package managers:

    Packages:
        nuxi@3.10.0 (default)
            binary tools: nuxi, nuxi-ng, nuxt, nuxt-cli
            platform:
                runtime: node@20.9.0
                package manager: npm@built-in

While running in the work profile returns this:

User toolchain:

    Node runtimes:
        v18.17.1 (default)

    Package managers:
        Yarn:
            v4.0.0 (default)

    Packages:
        @shopify/cli@3.52.0 (default)
            binary tools: shopify
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in
        @shopify/theme@3.52.0 (default)
            binary tools:
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in
        @vue/cli@5.0.8 (default)
            binary tools: vue
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in
        @withgraphite/graphite-cli@1.0.13 (default)
            binary tools: graphite, gt
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in
        nuxi@3.8.3 (default)
            binary tools: nuxi, nuxi-ng, nuxt, nuxt-cli
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in
        tailwind@4.0.0 (default)
            binary tools:
            platform:
                runtime: node@18.17.1
                package manager: npm@built-in

There's a version mismatch with Nuxi but I don't think that's the problem, could it be?

While I have Yarn installed in the work profile only, I'm using npm as the package manager for the Nuxt project.