Nuxt 3.3.2路径错误:M1 Mac执行npm run dev无法加载hookable模块
Nuxt项目在Macbook Air M1上运行
npm run dev报错问题 执行npm run dev命令时出现如下错误:
ERROR Failed to load url /@fs/Users/krzysztofjust/node_modules/hookable/dist/index.mjs?v=d68fa752 (resolved id: /Users/krzysztofjust/node_modules/hookable/dist/index.mjs?v=d68fa752) in /Users/krzysztofjust/node_modules/nuxt/dist/app/nuxt.js. Does the file exist?
已尝试的排查操作:
- 删除
node_modules目录与package-lock.json文件 - 重新执行
npm i重装依赖,但错误仍未解决
环境说明:
- 设备:Macbook Air M1
- npm版本:8.19.3
- Node.js版本:18.13.0
- 该项目在旧电脑环境下可正常运行
项目的package.json配置如下:
{ "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare", "generate-icons": "node assets/generate-icons/generate.js", "lintfix": "eslint --fix --ext \" .ts,.js,.vue\" --ignore-path .gitignore .", "lint:js": "eslint --ext \" .ts,.js,.vue\" --ignore-path .gitignore .", "lint:style-test": "stylelint **/*.{vue,css,scss} --ignore-path .gitignore", "lint:style": "stylelint **/*.{css,scss} --ignore-path .gitignore", "lint": "npm run lint:js && npm run lint:style" }, "dependencies": { "@nuxtjs/i18n": "8.0.0-beta.9", "@nuxtjs/robots": "^3.0.0", "@pinia/nuxt": "^0.4.7", "fantasticon": "^2.0.0", "gardevoir": "^1.0.0", "jwt-decode": "^3.1.2", "pinia": "^2.0.33", "vee-validate": "^4.8.4", "vite-svg-loader": "^4.0.0" }, "devDependencies": { "@nuxt/content": "^2.5.2", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "@vue/eslint-config-standard": "^8.0.1", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-nuxt": "^4.0.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.10.0", "prettier": "^2.8.7", "sass": "^1.60.0", "sass-loader": "^13.2.2", "stylelint": "^15.3.0", "stylelint-config-prettier-scss": "^0.0.1", "stylelint-config-standard-scss": "^7.0.1", "stylelint-prettier": "^3.0.0", "typescript": "^5.0.2" } }
内容的提问来源于stack exchange,提问作者Kris
相关产品推荐
相关产品推荐

