Skip to content

Cannot use vue cli commands in v4.3.1 #5422

@amansharma007

Description

@amansharma007

Version

4.3.1

Reproduction link

https://github.com/amansharma007/vue-router-demo

Environment info

node version: v14.0.0
npm version: v6.14.4

Steps to reproduce

After running npm install -g @vue/cli run vue create app-name and you will get this error,

internal/modules/cjs/loader.js:584
            if (e.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') throw e;
                                                            ^

Error [ERR_INVALID_PACKAGE_TARGET]: Invalid "exports" main target "index.js" defined in the package config /home/aman/.nvm/versions/node/v14.0.0/lib/node_modules/@vue/cli/node_modules/is-promise/package.json
    at resolveExportsTarget (internal/modules/cjs/loader.js:542:13)
    at resolveExportsTarget (internal/modules/cjs/loader.js:581:20)
    at applyExports (internal/modules/cjs/loader.js:455:14)
    at resolveExports (internal/modules/cjs/loader.js:508:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:632:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1001:27)
    at Function.Module._load (internal/modules/cjs/loader.js:884:27)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/aman/.nvm/versions/node/v14.0.0/lib/node_modules/@vue/cli/node_modules/run-async/index.js:3:17) {
  code: 'ERR_INVALID_PACKAGE_TARGET'
}

What is expected?

The expected result is that vue cli creates a vue project.

What is actually happening?

Any vue cli commands are showing the same error above..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions