【问题标题】:How to run a three.js project locally from codesandbox如何从 Codesandbox 本地运行 three.js 项目
【发布时间】:2022-01-21 12:31:20
【问题描述】:

我在 codesandbox 上找到了 three.js 项目,但我无法让它在本地工作。

在代码沙盒上它可以正常工作https://codesandbox.io/s/github/jmswrnr/website-examples/tree/master/3d-header/final-result,但是当我从https://github.com/jmswrnr/website-examples/tree/master/3d-header/final-result 下载代码并输入npm ci 然后npx parcel index.html --open 启动服务器时,我遇到了一些我无法修复的错误。我还尝试使用 webpack、parcel 和 vitejs 运行这个项目,但它也失败了。我不知道我做错了什么,但我认为导入模块有问题。如何在本地运行这个项目?

【问题讨论】:

    标签: module three.js codesandbox


    【解决方案1】:

    TLDR;

    npm install --save @babel/compat-data
    npm install --save parcel-bundler@1.12.3
    npm start
    
    

    仅供参考:
    请确保在使用 Stackoverflow 之前彻底谷歌错误。

    抛出了两个错误:
    Cannot find module '/website-examples/3d-header/final-result/node_modules/@babel/compat-data/data/corejs3-shipped-proposals'

    Cannot read properties of undefined (reading 'length') at lineCounter (/website-examples/3d-header/final-result/node_modules/parcel-bundler/src/utils/lineCounter.js:3:30)

    只是谷歌搜索parcel lineCounter 导致我第一个结果是 Github 问题:https://github.com/parcel-bundler/parcel/issues/2957

    【讨论】:

      猜你喜欢
      • 2020-11-05
      • 2023-02-10
      • 2021-12-28
      • 1970-01-01
      • 2020-05-01
      • 1970-01-01
      • 2020-04-10
      • 2023-03-29
      • 2018-12-27
      相关资源
      最近更新 更多