We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
React Native
使用框架: React
taro init
github
react-native
yarn dev:rn
error: src\app.css: Cannot find module '{projectPath}\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint\lib\utils\declarationValueIndex.cjs' imported from {projectPath}\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint-taro-rn\dist\index.esm.js
项目构建成功正常启动
由于stylelint-taro-rn找不到stylelint\lib\utils\declarationValueIndex.cjs文件,导致项目启动失败。
stylelint-taro-rn
stylelint\lib\utils\declarationValueIndex.cjs
Taro CLI 4.0.8 environment info: System: OS: Windows 11 10.0.22631 Binaries: Node: 18.18.2 - D:\node16\node.EXE Yarn: 1.22.22 - D:\node\npm_global\yarn.CMD npm: 9.8.1 - D:\node16\npm.CMD npmPackages: @tarojs/cli: 4.0.8 => 4.0.8 @tarojs/components: 4.0.8 => 4.0.8 @tarojs/components-rn: 4.0.8 => 4.0.8 @tarojs/helper: 4.0.8 => 4.0.8 @tarojs/plugin-framework-react: 4.0.8 => 4.0.8 @tarojs/plugin-platform-alipay: 4.0.8 => 4.0.8 @tarojs/plugin-platform-h5: 4.0.8 => 4.0.8 @tarojs/plugin-platform-jd: 4.0.8 => 4.0.8 @tarojs/plugin-platform-qq: 4.0.8 => 4.0.8 @tarojs/plugin-platform-swan: 4.0.8 => 4.0.8 @tarojs/plugin-platform-tt: 4.0.8 => 4.0.8 @tarojs/plugin-platform-weapp: 4.0.8 => 4.0.8 @tarojs/react: 4.0.8 => 4.0.8 @tarojs/rn-runner: 4.0.8 => 4.0.8 @tarojs/rn-supporter: 4.0.8 => 4.0.8 @tarojs/runtime: 4.0.8 => 4.0.8 @tarojs/runtime-rn: 4.0.8 => 4.0.8 @tarojs/shared: 4.0.8 => 4.0.8 @tarojs/taro: 4.0.8 => 4.0.8 @tarojs/taro-loader: 4.0.8 => 4.0.8 @tarojs/taro-rn: 4.0.8 => 4.0.8 @tarojs/webpack5-runner: 4.0.8 => 4.0.8 babel-preset-taro: 4.0.8 => 4.0.8 eslint-config-taro: 4.0.8 => 4.0.8 expo: ~50.0.21 => 50.0.21 react: ^18.2.0 => 18.2.0 react-native: ^0.73.1 => 0.73.1
问题分析:在stylelint-taro-rn的package.json中,依赖项stylelint的版本为^16.4.0,所以安装依赖时会安装最新版16.12.0,而文件stylelint\lib\utils\declarationValueIndex.cjs在stylelint 16.11.0后被移除。
package.json
stylelint
^16.4.0
16.12.0
stylelint 16.11.0
临时解决办法:在node_modules对应位置手动添加旧版本的declarationValueIndex.cjs,项目即可正常启动。
node_modules
declarationValueIndex.cjs
可能的解决方案:修改stylelint-taro-rn项目的package.json,将stylelint版本从^16.4.0改为>=16.4.0 <=16.10.0
>=16.4.0 <=16.10.0
The text was updated successfully, but these errors were encountered:
我也遇到了这个问题,的确是stylelint升级导致的,但我把版本降到存在这个文件的版本16.4.x,重新yarn start,依然提示找不到这个文件,但node modules目录中确认已经有了。不知道是否哪里还有缓存?
Sorry, something went wrong.
改自己项目依赖的sytlelint没用,因为报错的引用路径是node_modules -> stylelint-taro-rn -> node_modules -> stylelint而不是node_modules -> stylelint,所以我在 '\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint\lib\utils\'位置手动添加了旧版本的declarationValueIndex.cjs,这样项目就正常启动了
node_modules -> stylelint-taro-rn -> node_modules -> stylelint
node_modules -> stylelint
'\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint\lib\utils\'
我也遇到了这个问题,的确是stylelint升级导致的,但我把版本降到存在这个文件的版本16.4.x,重新yarn start,依然提示找不到这个文件,但node modules目录中确认已经有了。不知道是否哪里还有缓存? 改自己项目依赖的sytlelint没用,因为报错的引用路径是node_modules -> stylelint-taro-rn -> node_modules -> stylelint而不是node_modules -> stylelint,所以我在 '\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint\lib\utils\'位置手动添加了旧版本的declarationValueIndex.cjs,这样项目就正常启动了
是这样的
No branches or pull requests
相关平台
React Native
使用框架: React
复现步骤
taro init
正常创建项目,项目模板使用从github
拉取的react-native
,安装依赖,yarn dev:rn
,使用taro app扫码。error: src\app.css: Cannot find module '{projectPath}\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint\lib\utils\declarationValueIndex.cjs' imported from {projectPath}\node_modules\.pnpm\[email protected][email protected]\node_modules\stylelint-taro-rn\dist\index.esm.js
期望结果
项目构建成功正常启动
实际结果
由于
stylelint-taro-rn
找不到stylelint\lib\utils\declarationValueIndex.cjs
文件,导致项目启动失败。环境信息
补充信息
问题分析:在
stylelint-taro-rn
的package.json
中,依赖项stylelint
的版本为^16.4.0
,所以安装依赖时会安装最新版16.12.0
,而文件stylelint\lib\utils\declarationValueIndex.cjs
在stylelint 16.11.0
后被移除。临时解决办法:在
node_modules
对应位置手动添加旧版本的declarationValueIndex.cjs
,项目即可正常启动。可能的解决方案:修改
stylelint-taro-rn
项目的package.json
,将stylelint
版本从^16.4.0
改为>=16.4.0 <=16.10.0
The text was updated successfully, but these errors were encountered: