I'm trying to install a 'Log in with LinkedIn' functionality into a React app. Therefore I've used npx create-react-app kekap and ran npm install nvh95/react-linkedin-login-oauth2#pull/42/head, considering the current version install of react-linkedin-login-oauth2 wasn't working. After adding the sample files as proposed in the GitHub readme as a means of testing the application can't seem to find the module.
Failed to compile.
./src/App.js Module not found: Can't resolve 'react-linkedin-login-oauth2' in 'D:\workspaces\kekap\src'
My App.js:
import { Component } from 'react';
import { LinkedInPopUp } from 'react-linkedin-login-oauth2';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<BrowserRouter>
<Switch >
<Route exact path="/linkedin" component={LinkedInPopUp} />
</Switch>
</BrowserRouter>
</header>
</div>
);
}
}
export default App;
package.json:
{
"name": "kekap",
"homepage": "/wp-content/themes/screenr/templates/build/",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-linkedin-login-oauth2": "github:nvh95/react-linkedin-login-oauth2#pull/42/head",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
npm audit is giving me 82 moderate severity vulnerabilities. Fixes however switch me between versions @4.0.3 (current) and @1.1.5 (required by outdated module I'm guessing) of react-scripts.
Does anyone know how to fix this? How could I troubleshoot this further? Until now I've only followed a React course on Coursera, so I have little experience beyond what a simple Google query can solve.
Much thanks in advance!