Webpack 模块生成失败:错误:找不到模块'/globals.json';创建反应应用程序
我有一个createreact应用程序,我已经开发了一个月了 我现在在生成或运行时出错:Webpack 模块生成失败:错误:找不到模块'/globals.json';创建反应应用程序,webpack,create-react-app,Webpack,Create React App,我有一个createreact应用程序,我已经开发了一个月了 我现在在生成或运行时出错: npm run start 正在启动开发服务器。。。未能编译 ./src/index.js模块生成失败:错误:找不到模块 “./globals.json” 现在的问题是我甚至不知道去哪里找。它没有告诉我哪个模块有问题。有没有办法打开verbose以获取更多调试信息 任何指导都将不胜感激 My package.json: { "name": "hbi.contractor", "version":
npm run start
正在启动开发服务器。。。未能编译
./src/index.js模块生成失败:错误:找不到模块
“./globals.json”
现在的问题是我甚至不知道去哪里找。它没有告诉我哪个模块有问题。有没有办法打开verbose以获取更多调试信息
任何指导都将不胜感激
My package.json:
{
"name": "hbi.contractor",
"version": "0.1.0",
"private": true,
"homepage": "http://www.mysitecom.au/app",
"proxy": {
"/api/*": {
"target": "https://api.mysite.com.au",
"changeOrigin": true
}
},
"dependencies": {
"@fortawesome/fontawesome": "^1.1.8",
"axios": "^0.17.1",
"immutability-helper": "^2.7.0",
"inputmask": "^3.3.11",
"jquery": "^3.3.1",
"materialize-css": "^0.100.2",
"nodemon": "^1.17.4",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-dropzone": "^4.2.9",
"react-format-number": "^1.3.1",
"react-html-parser": "^2.0.2",
"react-ionicons": "^2.1.6",
"react-live-clock": "^2.0.3",
"react-load-script": "0.0.6",
"react-maskedinput": "^4.0.1",
"react-moment": "^0.7.0",
"react-owl-carousel": "^2.2.0",
"react-redirect": "^1.0.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-rxinput": "^1.0.4",
"react-scripts": "1.0.17",
"react-sticky": "^6.0.2",
"react-sticky-el": "^1.0.17",
"react-text-mask": "^5.4.1",
"redux": "^3.7.2",
"redux-form": "^6.8.0",
"redux-thunk": "^2.2.0",
"universal-cookie": "^2.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"react-input-mask": "^1.2.2",
"react-materialize": "^1.1.2",
"react-native-masked-text": "^1.6.5",
"react-number-format": "^3.3.4"
}
}
my index.js(入口点)
导入“jquery/dist/jquery.min.js”;
导入“MaterializeCSS/dist/js/materialize.js”;
从“React”导入React;
从“react dom”导入react dom;
从“react redux”导入{Provider};
从“redux”导入{createStore,applyMiddleware};
从“redux thunk”导入redux thunk;
从“/components/App”导入应用程序;
从“/reducers”导入减速机;
导入“/index.css”;
从“/utilities/queryString”导入queryString;
导入“MaterializeCSS/dist/css/materialize.min.css”;
const electionId=queryString.getParameterByName(“electionId”);
const store=createStore(reducer,{election:electionId},applyMiddleware(reduxThunk));
如果(选举ID){
ReactDOM.render(
,
document.querySelector(“根”)
);
}
否则{
ReactDOM.render(
缺少投票Id
,
document.querySelector(“根”)
);
}
我通过删除node\u modules文件夹,然后再次运行npm安装来修复此问题我认为这很可能与更新node或npm有关。。
import "jquery/dist/jquery.min.js";
import "materialize-css/dist/js/materialize.js";
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { createStore, applyMiddleware } from "redux";
import reduxThunk from "redux-thunk";
import App from "./components/App";
import reducers from "./reducers";
import "./index.css";
import queryString from "./utilities/querystring";
import "materialize-css/dist/css/materialize.min.css";
const electionId = queryString.getParameterByName("electionId");
const store = createStore(reducers, {election: electionId}, applyMiddleware(reduxThunk));
if (electionId){
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.querySelector("#root")
);
}
else{
ReactDOM.render(
<div>
Missing Vote Id
</div>,
document.querySelector("#root")
);
}