taro icon indicating copy to clipboard operation
taro copied to clipboard

新项目开发所有平台启动报错 Error: The specified module could not be found.

Open tolerance-go opened this issue 1 year ago • 6 comments

相关平台

H5

浏览器版本: chrome 121.0.6167.140 使用框架: React

复现步骤

  1. pnpm i 安装依赖
  2. pnpm dev:h5

期望结果

正常启动

实际结果

报错了

$ pnpm dev:h5

[email protected] dev:h5 C:\Users\yarnb\test\myApp6 npm run build:h5 -- --watch

[email protected] build:h5 taro build --type h5 --watch

👽 Taro v3.6.23

Error: The specified module could not be found. \?\C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor-win32-x64-msvc\taro-doctor.win32-x64-msvc.node at Object.Module._extensions..node (node:internal/modules/cjs/loader:1473:18) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object. (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor\js-binding.js:72:29) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Object.newLoader [as .js] (C:\Users\yarnb\test\myApp6\node_modules.pnpm\[email protected]\node_modules\pirates\lib\index.js:121:7) at Module.load (node:internal/modules/cjs/loader:1207:32) { code: 'ERR_DLOPEN_FAILED' } Error: The specified module could not be found. \?\C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor-win32-x64-msvc\taro-doctor.win32-x64-msvc.node at Object.Module._extensions..node (node:internal/modules/cjs/loader:1473:18) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object. (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor\js-binding.js:72:29) at Module.compile (node:internal/modules/cjs/loader:1376:14) at Module.extensions..js (node:internal/modules/cjs/loader:1435:10) at Object.newLoader [as .js] (C:\Users\yarnb\test\myApp6\node_modules.pnpm\[email protected]\node_modules\pirates\lib\index.js:121:7) at Module.load (node:internal/modules/cjs/loader:1207:32) { code: 'ERR_DLOPEN_FAILED' } C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]@[email protected]@[email protected]\node_modules@tarojs\service\dist\utils\index.js:89 throw new Error(插件依赖 "${item}" 加载失败,请检查插件配置); ^

Error: 插件依赖 "C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]\node_modules@tarojs\cli\dist\presets\commands\build.js" 加载失败,请检查插件配置 at apply (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\src\utils\index.ts:84:19) at Kernel.initPlugin (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\src\Kernel.ts:181:5) at Kernel.resolvePlugins (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\src\Kernel.ts:150:12) at Kernel.initPresetsAndPlugins (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\src\Kernel.ts:123:10) at Kernel. (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\src\Kernel.ts:354:10) at Generator.next () at C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\dist\Kernel.js:8:71 at new Promise () at awaiter (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]@[email protected]@[email protected]\node_modules@tarojs\service\dist\Kernel.js:4:12) at Kernel.run (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]_@[email protected]_@[email protected]\node_modules@tarojs\service\dist\Kernel.js:285:16)

Node.js v20.11.0  ELIFECYCLE  Command failed with exit code 1.

环境信息

我获取环境信息直接报错了。。。

$ pnpm taro info 👽 Taro v3.6.23

Error: The specified module could not be found. \?\C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor-win32-x64-msvc\taro-doctor.win32-x64-msvc.node at Object.Module._extensions..node (node:internal/modules/cjs/loader:1473:18) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at Object. (C:\Users\yarnb\test\myApp6\node_modules.pnpm@[email protected]\node_modules@tarojs\plugin-doctor\js-binding.js:72:29) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Object.newLoader [as .js] (C:\Users\yarnb\test\myApp6\node_modules.pnpm\[email protected]\node_modules\pirates\lib\index.js:121:7) at Module.load (node:internal/modules/cjs/loader:1207:32) { code: 'ERR_DLOPEN_FAILED' } 找不到项目配置文件config/index,请确定当前目录是 Taro 项目根目录!


补充信息

我是用 npx 安装的,最新的 是"@tarojs/cli": "3.6.23", issue 帮助生成页面最高是3.3.16

tolerance-go avatar Feb 02 '24 09:02 tolerance-go

线上项目 https://github.com/tolerance-go/test-taro

tolerance-go avatar Feb 02 '24 09:02 tolerance-go

windows11 环境

tolerance-go avatar Feb 02 '24 09:02 tolerance-go

我使用taro4创建项目的时候,h5和微信小程序端无法启动,其他平台没尝试 image image

Jack-Z-Coding avatar Feb 05 '24 15:02 Jack-Z-Coding

win10 node:v20.0.0

Jack-Z-Coding avatar Feb 05 '24 15:02 Jack-Z-Coding

和楼主同样的错误,请问解决了吗

angleneo avatar Mar 18 '24 02:03 angleneo

相同的情况,在安装vc++之后解决了。

Boncen avatar May 10 '24 02:05 Boncen

同样的错误,安装 VC++ 解决,请查看 image

b-yp avatar Jun 04 '24 01:06 b-yp