Open 502647092 opened 4 weeks ago
你好,可以尝试把lock文件删除后重新安装依赖试试,如果还无法解决,麻烦提供一下可复现demo
@ZEJIA-LIU
创建容器环境 docker run -d --name node-alpine node:18-alpine3.18 tail -f
进入容器环境执行初始化 docker exec -it node-alpine sh
/ $ npm install -g @tarojs/cli
/ $ mkdir /data && cd /data
/data $ taro init
/data # taro init
👽 Taro v4.0.4
node:internal/modules/cjs/loader:1077
const err = new Error(message);
^
Error: Cannot find module '@tarojs/binding-linux-x64-musl'
Require stack:
- /usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/binding/binding.js
- /usr/local/lib/node_modules/@tarojs/cli/dist/create/project.js
- /usr/local/lib/node_modules/@tarojs/cli/dist/presets/commands/init.js
- /usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/utils/index.js
- /usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/Kernel.js
- /usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/index.js
- /usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/index.js
- /usr/local/lib/node_modules/@tarojs/cli/dist/cli.js
- /usr/local/lib/node_modules/@tarojs/cli/bin/taro
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Function.Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/binding/binding.js:175:31)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.newLoader [as .js] (/usr/local/lib/node_modules/@tarojs/cli/node_modules/pirates/lib/index.js:121:7)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Function.Module._load (node:internal/modules/cjs/loader:960:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/binding/binding.js',
'/usr/local/lib/node_modules/@tarojs/cli/dist/create/project.js',
'/usr/local/lib/node_modules/@tarojs/cli/dist/presets/commands/init.js',
'/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/utils/index.js',
'/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/Kernel.js',
'/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/dist/index.js',
'/usr/local/lib/node_modules/@tarojs/cli/node_modules/@tarojs/service/index.js',
'/usr/local/lib/node_modules/@tarojs/cli/dist/cli.js',
'/usr/local/lib/node_modules/@tarojs/cli/bin/taro'
]
}
Node.js v18.18.1
相关平台
微信小程序
小程序基础库: 3.8.5 使用框架: Preact
复现步骤
期望结果
在
alpine
初始化后可以正常运行实际结果
需要安装
@tarojs/binding-linux-x64-musl
环境信息