'when i try to run the project with library @google/model-viewer by npm start i get this error
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 ( ) } }
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Drew Reese |
