我现在已经编制了我的项目好几个月了,这从来都不是问题。我今天的大部分时间用npm run watch
进行编码。然后它突然停止编译CSS,看着仍在运行,但CSS没有更新。
对Bitbucket的提交揭示了以下内容:
公共/混合-的manifest.json
{
- "/js/app.js": "/js/app.js",
- "/css/app.css": "/css/app.css"
+ "/js/app.js": "/js/app.js"
}
app.css已被删除?
公共/ JS / app.js
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
+/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
-/******/ }
+/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
...
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_passwordValidator__ = __webpack_require__(9);
+/* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_passwordValidator__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_passwordShowHide__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_selectComponent__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_showHideComponent__ = __webpack_require__(11);
...
/* 2 */
/***/ (function(module, exports) {
-// removed by extract-text-webpack-plugin
+throw new Error("Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve './images/dashboard-details-2.jpg' in 'F:\\openvisa-webapp\\resources\\assets\\sass'\n at factoryCallback (F:\\openvisa-webapp\\node_modules\\webpack\\lib\\Compilation.js:260:39)\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:243:19\n at onDoneResolving (F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:59:20)\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:132:20\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:3799:9\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:360:16\n at iteratorCallback (F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:934:13)\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:844:16\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:3796:13\n at apply (F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:21:25)\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:56:12\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:124:22\n at onResolved (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:70:11)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at afterInnerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:138:10)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at Resolver.applyPluginsAsyncSeriesBailResult1 (F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:181:46)\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:125:19)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:283:15\n at F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\UnsafeCachePlugin.js:38:4\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at afterInnerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:138:10)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at Resolver.applyPluginsAsyncSeriesBailResult1 (F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:181:46)\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:125:19)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:283:15\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:123:11)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)");
/***/ }),
/* 3 */
我已经尝试将public / mix-manifest.json配置回原来的样式:
公共/混合-的manifest.json
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}
运行npm run watch
或npm run dev
,它只会移除"/css/app.css": "/css/app.css"
公共/混合-的manifest.json
{
-"/js/app.js": "/js/app.js",
-"/css/app.css": "/css/app.css"
+"/js/app.js": "/js/app.js"
}
运行npm run dev
后得到的节点错误是:
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Cory\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\openvisa-webapp\npm-debug.log
请注意我在运行npm run watch
时没有收到此错误,它只是不编译CSS,此错误仅出现在npm run dev
上。但是,watch
上仍然存在错误。
我不知道如何修复它。我试过了npm install
,但没有任何作用。
答案 0 :(得分:0)
问题已经解决。如果您的CSS背景图像没有正确的路径,就会发生这种情况。