0

I tried to compile my project and ended with this error message....

1

package.json
"name": "facerecognitionbrain",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "clarifai": "^2.9.1",
    "particles-bg": "^2.5.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-parallax-tilt": "^1.7.67",
    "react-scripts": "^5.0.1",
    "tachyons": "^4.12.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "web-vitals": "^3.1.1"
  }
}

hope someone has a solution...thanks

Other suggestions I have tried is to copy package.json and package-lock.json from the github repo of our instructor, deleted all node_modules and re-installed with npm ci. It just reduced my errors to 2.

Lloyd
  • 1
  • 2
  • Have you checked if these modules are installed? Look here maybe it helps https://stackoverflow.com/questions/65396568/react-js-npm-start-shows-failed-to-compile-web-vitals – Woogielicious Jan 16 '23 at 08:34
  • yes the web vitals install did the trick... – Lloyd Jan 16 '23 at 09:43

1 Answers1

0

it seems you dont have these packages installed. You can try to run npm install clarifai-nodejs-grpc web-vitals.

Also deleting the package.lock.json and node_modules and running npm install again should work if you have these two packages listed on your package.json dependencies.


Added after addition of the package json to the question:

It seems from your package json that you have installed the clarifai package: github.com/Clarifai/clarifai-javascript, and not the clarifai-nodejs-grpc package: github.com/Clarifai/clarifai-nodejs-grpc. Make sure to install the right one according to your use case, and use the right one on the code. If you could also add how you are importing the package on your code, it could make things clearer. But it seems you are importing clarifai-nodejs-grpc package in the code while you have clarifai package installed.

According to their github you should use clarifai-nodejs-grpc

So:

  • remove the clarifai from the dependencies on you package json
  • run npm install
  • run npm install clarifai-nodejs-grpc
  • I tried your suggestion...the web vitals error is gone...the other errors still around... – Lloyd Jan 16 '23 at 09:42
  • what are the other errors? can you be specific? – Zeev Noiman Jan 16 '23 at 11:12
  • Error: Can't resolve 'clarifai-nodejs-grpc' in c::\...\src – Lloyd Jan 16 '23 at 13:19
  • Can you add to the question your dependencies on the package.json? I would like to see how this package is defined inside the file. Maybe it is defined as dev dependencies? – Zeev Noiman Jan 16 '23 at 16:52
  • It seems from your package json that you have installed the clarifai package: https://github.com/Clarifai/clarifai-javascript, and not the clarifai-nodejs-grpc package: https://github.com/Clarifai/clarifai-nodejs-grpc. Make sure to install the right one according to your use case, and use the right one on the code. If you could also add how you are importing the package on your code, it could make things clearer. But it seems you are importing clarifai-nodejs-grpc package in the code while you have clarifai package installed. I edited my answer now you have added the package to the question – Zeev Noiman Jan 17 '23 at 20:11