Svelte,Skeleton,Tailwind npm安装错误

x4shl7ld  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(118)

我很新的苗条/typescript的世界,因为昨天突然我得到一些错误后安装。几天前我就做了同样的事情,我不明白发生了什么。
这就是我所做的:

npm create svelte@latest diceGame

cd diceGame

npm install

然后我安装了骷髅

npm i @skeletonlabs/skeleton --save-dev

然后我安装了Tailwind

npx svelte-add@latest tailwindcss

npm install

现在我得到的错误,你可以看到在屏幕截图

有什么帮助/建议,我可以做什么有一个干净的安装?

xzv2uavs

xzv2uavs1#

跟着skeleton UI get started documentation走。
我最近遵循了这些步骤几次,从来没有遇到过问题。

npm create svelte@latest diceGame
cd diceGame
npm i
npm i -D @skeletonlabs/skeleton @skeletonlabs/tw-plugin
npx svelte-add@latest tailwindcss
npm i
npm add -D @types/node

然后,使用.ts文件扩展名设置Tailwind配置。

import { join } from 'path';
import type { Config } from 'tailwindcss';

// 1. Import the Skeleton plugin
import { skeleton } from '@skeletonlabs/tw-plugin';

const config = {
    // 2. Opt for dark mode to be handled via the class method
    darkMode: 'class',
    content: [
        './src/**/*.{html,js,svelte,ts}',
        // 3. Append the path to the Skeleton package
        join(require.resolve(
            '@skeletonlabs/skeleton'),
            '../**/*.{html,js,svelte,ts}'
        )
    ],
    theme: {
        extend: {},
    },
    plugins: [
        // 4. Append the Skeleton plugin (after other plugins)
        skeleton
    ]
} satisfies Config;

export default config;

相关问题