gpt4 book ai didi

reactjs - 找不到雪包 "abstracts/variables"。你安装了吗?运行 npm start 时出现此错误

转载 作者:行者123 更新时间:2023-12-03 20:49:04 24 4
gpt4 key购买 nike

运行 npm start 时出现此错误
使用过snowpack.dev https://www.snowpack.dev/
snow

[snowpack] ! updating dependencies...
[snowpack] ! installing dependencies…
[snowpack] Package "abstracts/variables" not found. Have you installed it?
[snowpack] Install failed.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `snowpack dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-09-15T12_18_05_035Z-debug.log
PS G:\antonio\projects\react\app>

最佳答案

您在使用 baseUrltsconfig.json ?
如果您正在导入 ./src/abstractsabstracts/[whateverfile]通过 baseUrl配置,您需要在您的 snowpack 配置文件中设置别名( Docs here )。

  • 创建 snowpack.config.js如果你还没有这样做。将它放在您的应用程序的根目录中,旁边是您的 package.json .
  • snowpack.config.js , 添加:

  • module.exports = {

    ...

    alias: {
    abstracts: '/src/abstracts',
    // continue for remaining directories in /src
    },

    ...

    }


    关于reactjs - 找不到雪包 "abstracts/variables"。你安装了吗?运行 npm start 时出现此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63901843/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com