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

Cannot start dev server with error (node:21264) UnhandledPromiseRejectionWarning: Error #618

Closed
Runaria opened this issue Jul 24, 2020 · 1 comment

Comments

@Runaria
Copy link

Runaria commented Jul 24, 2020

Describe the bug

Error occured while running yarn dev command

Reproduction

$ yarn create vite-app <project-name>
$ cd <project-name>
$ yarn
$ yarn dev
yarn run v1.22.4
warning package.json: No license field
$ vite
vite v1.0.0-rc.3
(node:21264) UnhandledPromiseRejectionWarning: Error: Package exports for 'F:\project\demo\vitedemo\node_modules\koa' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:545:13)
    at applyExports (internal/modules/cjs/loader.js:459:14)
    at resolveExports (internal/modules/cjs/loader.js:508:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:577:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:879:27)
    at Function.Module._load (internal/modules/cjs/loader.js:785:27)
    at Module.require (internal/modules/cjs/loader.js:956:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (F:\project\demo\vitedemo\node_modules\vite\dist\node\server\index.js:9:31)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
(node:21264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.Done in 0.28s.

System Info

  • required vite version: v1.0.0-rc.3
  • required Operating System: Windows 10 (1909)
  • required Node version: v13.1.0
  • Optional:
    • yarn version 1.22.4
    • Installed vue version (from yarn.lock) 3.0.0-rc.4
    • Installed @vue/compiler-sfc version 3.0.0-rc.4

Logs

F:\project\demo>yarn create vite-app vitedemo
yarn create v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-vite-app@1.18.0" with binaries:
      - create-vite-app
      - cva
[########] 8/8Scaffolding project in F:\project\demo\vitedemo...

Done. Now run:

  cd vitedemo
  npm install (or `yarn`)
  npm run dev (or `yarn dev`)

Done in 0.73s.


F:\project\demo>cd vitedemo

F:\project\demo\vitedemo>yarn
warning package.json: No license field
info No lockfile found.
warning vitedemo@0.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "win32" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 32.17s.

F:\project\demo\vitedemo>yarn dev
yarn run v1.22.4
warning package.json: No license field
$ vite
vite v1.0.0-rc.3
(node:21264) UnhandledPromiseRejectionWarning: Error: Package exports for 'F:\project\demo\vitedemo\node_modules\koa' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:545:13)
    at applyExports (internal/modules/cjs/loader.js:459:14)
    at resolveExports (internal/modules/cjs/loader.js:508:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:577:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:879:27)
    at Function.Module._load (internal/modules/cjs/loader.js:785:27)
    at Module.require (internal/modules/cjs/loader.js:956:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (F:\project\demo\vitedemo\node_modules\vite\dist\node\server\index.js:9:31)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
(node:21264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.Done in 0.28s.
@underfin
Copy link
Member

underfin commented Jul 24, 2020

Related with nodejs/modules#446.
You can upgrade your node.js versions >= 13.2.0

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants