Maven 安装警告 [英] Maven Install Warnings

查看:83
本文介绍了Maven 安装警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 React 和 webpack 的新手.Maven 似乎无法处理我的 css 文件.运行 mvn install 在我的 CSS 文件的第一个字符上有一个语法错误意外标记.这与我收到的这个警告有关吗?

I'm new to react and webpack. Maven seems to be unable to process my css files. Running mvn install has a syntax error unexpected token on the first character of my CSS file. Does it have to do with this warning I'm getting?

[WARNING] npm WARN webpack-cli@2.0.14 requires a peer of webpack@^4.0.0 but none was installed.

我尝试将 webpack 更新到 4.0.0 版本,但这给了我 babel-loader 问题.我是追踪 Maven 依赖项的新手.任何人都可以接受我的 package.json 配置和 maven 输出吗?任何帮助将不胜感激.

I tried updating webpack to that version 4.0.0 but that gave me babel-loader issues. I'm new to tracking down maven dependencies. Can anyone take at my package.json config and maven output? Any help would be appreciated.

这是我的 package.json:

Here's my package.json:

{
  "name": "misdeal",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^15.3.2",
    "react-dom": "^15.3.2",
    "rest": "^1.3.1",
    "webpack": "^1.12.2"
  },
  "scripts": {
    "watch": "webpack --watch -d"
  },
  "devDependencies": {
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.7",
    "babel-polyfill": "^6.16.0",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "webpack-cli": "^2.0.14"
  }
}

这是 maven 安装输出:

Here's the maven install output:

[INFO] --- frontend-maven-plugin:1.2:install-node-and-npm (install node and npm) @ misdeal ---
[INFO] Installing node version v4.4.5
[INFO] Copying node binary from C:\Users\btillinghast\.m2\repository\com\github\eirslett\node\4.4.5\node-4.4.5-win-x64.exe to C:\Users\btillinghast\git\misdeal\target\node\node.exe
[INFO] Installed node locally.
[INFO] Installing npm version 3.9.2
[INFO] Unpacking C:\Users\btillinghast\.m2\repository\com\github\eirslett\npm\3.9.2\npm-3.9.2.tar.gz into C:\Users\btillinghast\git\misdeal\target\node\node_modules
[INFO] Installed npm locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.2:npm (npm install) @ misdeal ---
[INFO] Running 'npm install' in C:\Users\btillinghast\git\misdeal
[WARNING] npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
[WARNING] npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.1.3
[WARNING] npm WARN webpack-cli@2.0.14 requires a peer of webpack@^4.0.0 but none was installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.2:webpack (webpack build) @ misdeal ---
[INFO] Running 'webpack.js ' in C:\Users\btillinghast\git\misdeal
[INFO] Hash: 6c98a449ae4f6374613a
[INFO] Version: webpack 1.15.0
[INFO] Time: 1332ms
[INFO]                                           Asset    Size  Chunks             Chunk Names
[INFO]     ./src/main/resources/static/built/bundle.js  756 kB       0  [emitted]  main
[INFO] ./src/main/resources/static/built/bundle.js.map  880 kB       0  [emitted]  main
[INFO]     + 187 hidden modules
[INFO]
[INFO] ERROR in ./src/main/resources/static/App.css
[INFO] Module build failed: SyntaxError: C:/Users/btillinghast/git/misdeal/src/main/resources/static/App.css: Unexpected token (1:0)
[INFO]
[INFO] > 1 | .App {
[INFO]     | ^
[INFO]   2 |   text-align: center;
[INFO]   3 | }
[INFO]   4 |
[INFO]
[INFO]  @ ./src/main/js/containers/App.js 13:0-41

推荐答案

您需要更新Webpack,您的版本已过时,当前版本为4.5.0 您安装的版本是 1.12.2Webpack CLI 至少需要版本 4.0.0

You need to update Webpack, the version you have is outdated, the current version is 4.5.0 the version you have installed is 1.12.2 and Webpack CLI requires at least version 4.0.0

试试 npm update -g webpack

如果这不起作用

试试 npm install --save-dev webpack

或用纱线

试试yarn add webpack --dev

这篇关于Maven 安装警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆