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

failed to start server. error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: #456

Closed
skyroam opened this issue Dec 2, 2021 · 9 comments
Closed
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@skyroam
Copy link

skyroam commented Dec 2, 2021

Describe the bug

Hi, when I served the documentation site in the local server with the command 'yarn docs:dev`, a error happened.

[root@calm-spin-2 doc.xxx.org]# yarn docs:dev
yarn run v1.22.17
warning package.json: No license field
$ vitepress dev docs
vitepress v0.20.1
failed to start server. error:
 Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/vue.runtime.esm-bundler.js' is not defined by "exports" in /home/wwwroot/doc.xxx.org/node_modules/vue/package.json
    at applyExports (internal/modules/cjs/loader.js:490:9)
    at resolveExports (internal/modules/cjs/loader.js:506:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:634:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:27)
    at Function.resolve (internal/modules/cjs/helpers.js:78:19)
    at resolveAliases (/home/wwwroot/doc.xxx.org/node_modules/vitepress/dist/node/serve-3fdbda2c.js:12333:28)
    at resolveConfig (/home/wwwroot/doc.xxx.org/node_modules/vitepress/dist/node/serve-3fdbda2c.js:13374:12)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.createServer (/home/wwwroot/doc.xxx.org/node_modules/vitepress/dist/node/serve-3fdbda2c.js:36633:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[root@calm-spin-2 doc.wandersky.org]# node --version
v12.18.3

Why did this happen? Should I update the node?

Reproduction

I install the vitepress according to this tutorial totally. Until this command: yarn docs:dev, the error occurred.

Expected behavior

installed succussfully

System Info

centos7 

npx: installed 1 in 1.808s

  System:
    OS: Linux 4.10 CentOS Linux 7 (Core)
    CPU: (2) x64 QEMU Virtual CPU version (cpu64-rhel6)
    Memory: 95.36 MB / 1007.73 MB
    Container: Yes
    Shell: 4.2.46 - /bin/bash
  Binaries:
    Node: 12.18.3 - /usr/local/src/node-v12.18.3-linux-x64/bin/node
    Yarn: 1.22.17 - /usr/local/src/node-v12.18.3-linux-x64/bin/yarn
    npm: 6.14.6 - /usr/local/src/node-v12.18.3-linux-x64/bin/npm
  npmPackages:
    vitepress: ^0.20.1 => 0.20.1 


### Additional context

_No response_

### Validations

- [X] Follow our [Code of Conduct](https://vuejs.org/coc)
- [X] Read the [docs](https://vitepress.vuejs.org/).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@skyroam skyroam added the bug: pending triage Maybe a bug, waiting for confirmation label Dec 2, 2021
@skyroam
Copy link
Author

skyroam commented Dec 4, 2021

I solve this problem by upgrade node to v16

@theKHR3b
Copy link

theKHR3b commented Jan 10, 2022

Node v12.18.3 - same error.
vitepress version: "^0.21.4"

@brc-dd
Copy link
Member

brc-dd commented Jan 31, 2022

Are you able to reproduce this on Node.js 12.22.9 and VitePress 0.21.6?

vue has exports field in its package.json since v3.2.18. So, this should not be an issue now.

@Jojoshua
Copy link

Jojoshua commented Feb 7, 2022

I got this same error testing out vitepress today. I am using node 13.1.0. I installed this via npm

@yyx990803
Copy link
Member

VitePress requires Node 14+.

@brc-dd
Copy link
Member

brc-dd commented Feb 22, 2022

@yyx990803 We probably need to change the engines field then:

vitepress/package.json

Lines 45 to 47 in 33a59cd

"engines": {
"node": ">=12.0.0"
},

@hashiqi12138
Copy link

i got this error on node 14.8.0

vitePress 0.22.3

vue 3.2.31

@victorlmneves
Copy link

Also doesn't work with node 14.7.0
But I can say it works with 14.15.0

@bjankord
Copy link

Ran into this on node 14.4.0, resolved when updating to node 14.19.1.
Would recommend updating the engines field from "node": ">=14.0.0" to "node": ">=14.15.0"

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

8 participants