ErKeLost / create-vite-app

🍰🍰 VIte-CLI resolve Vite create starter template No need to configure vite scaffolding templates quickly build vite4.x development templates highly customized Vue3.x React 18 Vite5.x
https://vite-cli.netlify.app/
223 stars 32 forks source link

[vite] Internal server error: Failed to resolve entry for package "@relaxed/utils". The package may have incorrect main/module/exports specified in its package.json. #52

Closed Henrycheheng closed 1 year ago

Henrycheheng commented 1 year ago

Steps to reproduce

1.use

  npx create-vite-template@latest

2.pnpm i 3.then i got this error

What is expected?

i wanna the project is able to run

What is actually happening?

it's occur an error said: [vite] Internal server error: Failed to resolve entry for package "@relaxed/utils". The package may have incorrect main/module/exports specified in its package.json. package.json is like this

{
  "name": "vite-template",
  "private": true,
  "version": "1.0.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview",
    "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
    "prettier": "prettier --write ./**/*.{html,vue,ts,js,json,md}",
    "type-check": "vue-tsc --noEmit"
  },
  "dependencies": {
    "@erkelost/colorpicker": "^1.0.8",
    "@relaxed/layout": "^2.0.17",
    "@relaxed/utils": "^2.0.17",
    "@vueuse/core": "9.13.0",
    "@vueuse/head": "1.1.23",
    "colord": "^2.9.2",
    "css-color-function": "^1.3.3",
    "element-plus": "^2.3.0",
    "pinia": "^2.0.33",
    "pinia-plugin-persistedstate": "^3.1.0",
    "vue": "^3.2.47",
    "vue-router": "^4.1.6"
  },
  "devDependencies": {
    "@iconify-json/carbon": "^1.1.16",
    "@iconify-json/ic": "^1.1.13",
    "@pureadmin/theme": "^2.0.0",
    "@types/node": "^18.15.3",
    "@typescript-eslint/eslint-plugin": "^5.44.0",
    "@typescript-eslint/parser": "^5.44.0",
    "@vitejs/plugin-legacy": "^4.0.2",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vitejs/plugin-vue-jsx": "^3.0.1",
    "eslint": "^8.36.0",
    "eslint-config-prettier": "^8.7.0",
    "eslint-plugin-prettier": "^4.2.1",
    "prettier": "^2.8.4",
    "rollup-plugin-visualizer": "^5.9.0",
    "sass": "^1.59.3",
    "typescript": "^5.0.2",
    "unocss": "^0.50.6",
    "unplugin-auto-import": "^0.15.1",
    "unplugin-icons": "^0.15.3",
    "unplugin-vue-components": "^0.24.1",
    "vite": "^4.2.0",
    "vite-plugin-html": "^3.2.0",
    "vite-plugin-inspect": "^0.7.17",
    "vite-plugin-pwa": "^0.14.4",
    "vue-tsc": "^1.2.0"
  }
}

is there a problem with this package called @relaxed/utils'

System Info

windows 11
vite/4.3.9 
win32-x64 
node-v16.15.1

Any additional comments?

No response

Henrycheheng commented 1 year ago

i found that the version of my node is incorrect, which version is recommended?

ErKeLost commented 1 year ago

Thank you for your use. May I ask if you have the following configuration?

image

I can run the test here.

image

image

Or you can update the @ relaxed/utils version and try it. Install the latest version.

Henrycheheng commented 1 year ago

yes, i choose all the options of this cli. use pnpm as package manager. i'm update the version of @ relaxed/utils to the latest. image this error is still. i guess my version of node is not correct. u use which version (can be successful)

Henrycheheng commented 1 year ago

it's seem to said: this package, @ relaxed/utils, may not have correct main/modules/exports in its package.json. so i first to Verify package installation, image the second is Check package.json configuration: Open the package.json file of the "@relaxed/utils" package and ensure that it has the correct main, module, or exports fields specified. These fields determine the entry points for the package. image is there missing module options cus this problem?

and then,if this is ever exist, i found Sometimes, Vite's internal cache can cause issues. image but still exist. could u help me to check out the second step? this way sir. https://github.com/ErKeLost/relaxed/blob/master/packages/utils/package.json

Henrycheheng commented 1 year ago

and acrio design is ok image

ErKeLost commented 1 year ago

I have time to take a look at this version, because anyone with a theme will use this tool library that does not provide a theme.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 3 days since being marked as stale.