当我尝试使用library @google/model-ciewer by NPM开始时,我会得到此错误

发布于 2025-01-19 05:52:07 字数 754 浏览 4 评论 0原文

这是我的 package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@google/model-viewer": "^1.11.0",
    "react": "^18.0.0"
  }
}

`PS C:\Users\AA\Desktop\3Dpro\my-app> npm 启动 npm 错误!缺少脚本:“开始” npm 错误! npm 错误!您指的是其中之一吗? npm 错误! npm star # 标记你最喜欢的包
npm 错误! npm star # 查看标记为收藏夹的包 npm 错误! npm 错误!要查看脚本列表,请运行: npm 错误! npm 运行

npm 错误!此运行的完整日志可以在以下位置找到: npm 错误! C:\Users\AA\AppData\Local\npm-cache_logs\2022-04-05T20_22_54_567Z-debug-0.log PS C:\Users\AA\Desktop\3Dpro\my-app>

我正在使用 3D 库 (@google/model-viewer)

这是我的代码: 导入“@google/model-viewer” import React, { Component } from 'react'

导出默认类 PersonalDesign extends Component { 使成为() { 返回 ( ) } }

this is my package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@google/model-viewer": "^1.11.0",
    "react": "^18.0.0"
  }
}

`PS C:\Users\AA\Desktop\3Dpro\my-app> npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AA\AppData\Local\npm-cache_logs\2022-04-05T20_22_54_567Z-debug-0.log
PS C:\Users\AA\Desktop\3Dpro\my-app>

I am using a library for 3D ( @google/model-viewer)

this is my code:
import '@google/model-viewer'
import React, { Component } from 'react'

export default class PersonalDesign extends Component {
render() {
return (

)
}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿挽旧人 2025-01-26 05:52:07

看起来您的 package.json 文件由于某种原因缺少脚本。将它们添加回来。您似乎还缺少 react-domreact-scripts 依赖项。

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@google/model-viewer": "^1.11.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-scripts": "^4.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

更新/保存 package.json 文件后,运行 npm i 安装依赖项,然后运行 ​​npm start 启动项目。

Looks like your package.json file is missing the scripts for some reason. Add them back in. You also appear to be missing the react-dom and react-scripts dependencies.

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@google/model-viewer": "^1.11.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-scripts": "^4.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

After updating/saving your package.json file, run npm i to install the dependencies and then run npm start to start your project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文