Je devais apporter des modifications sur le module de réact-gros calendrier, donc j'ai ramené le projet sur GitHub, apporté des modifications et poussées. Ensuite, j'ai utilisé cette commande pour installer le nouveau paquet:
npm install https://github.com/wafa-yahyaoui/react-big-calendar/tarball/master --save
Le forfait figure dans les dépendances sur Package.json:
"dependencies": {
"@babel/runtime": "7.0.0-beta.55",
"@fortawesome/fontawesome-svg-core": "^1.2.10",
"@fortawesome/free-solid-svg-icons": "^5.6.1",
"@fortawesome/react-fontawesome": "^0.1.3",
"@material-ui/core": "^3.6.2",
"@material-ui/icons": "^2.0.3",
"@types/googlemaps": "3.30.11",
"@types/markerclustererplus": "2.1.33",
"ajv": "6.5.2",
"axios": "^0.18.0",
"bootstrap": "^4.1.3",
"chartist": "^0.11.0",
"classnames": "2.2.6",
"emotion": "^10.0.5",
"enhanced-resolve": "^3.4.1",
"globalize": "^1.4.0",
"history": "^4.7.2",
"iban": "0.0.11",
"jwt-decode": "^2.2.0",
"moment": "2.22.2",
"perfect-scrollbar": "1.4.0",
"react": "^16.6.3",
"react-big-calendar": "https://github.com/wafa-yahyaoui/react-big-calendar/tarball/master",
"react-bootstrap-sweetalert": "^4.4.1",
"react-chartist": "^0.13.1",
"react-datetime": "^2.16.3",
"react-dom": "^16.6.3",
"react-facebook-pixel": "^0.1.2",
"react-ga": "^2.5.6",
"react-google-maps": "^9.4.5",
"react-jvectormap": "0.0.3",
"react-nouislider": "2.0.1",
"react-redux": "^5.1.1",
"react-router": "4.3.1",
"react-router-dom": "^4.3.1",
"react-router-redux": "^5.0.0-alpha.9",
"react-scripts": "1.1.4",
"react-spinners": "^0.4.7",
"react-swipeable-views": "0.12.15",
"react-table": "6.8.6",
"react-tagsinput": "3.19.0",
"react-transition-group": "^1.2.1",
"reactstrap": "^6.5.0",
"redux": "^4.0.1",
"redux-api-middleware": "^2.3.0",
"redux-persist": "^5.10.0",
"redux-persist-transform-filter": "0.0.18",
"redux-thunk": "^2.3.0",
"universal-cookie": "^3.0.7"}
J'ai supprimé le dossier Node_Modules, a ran npm install
Mais lorsque vous courez npm start
J'ai cette erreur:
./src/containers/apartments/calendar.js
Module not found: Can't resolve 'react-big-calendar' in
'/Users/wafayahyaoui/homereact/src/containers/apartments'
Les importations sur le fichier calendrier.js ressemble à ceci:
import React from "react";
import BigCalendar from "react-big-calendar";
Quelle peut être la source si l'erreur d'importation? Je vous remercie
J'ai eu un problème similaire, alors peut-être que ce serait utile à quelqu'un. main
propriété de package.json
indiquait au fichier construit qui n'était pas accessible, alors j'ai ajouté un script prepare
pour exécuter la construction avant de publier le package.
"main": "dist/index.js",
"scripts": {
"prepare": "npm run build"
}