我想使用npm run build运行 Webpack,但它在终端中出现错误
error: unknown option '-p'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
C:\React Projects\Webpack\Project>
Run Code Online (Sandbox Code Playgroud)
包.json
{
"name": "project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"webpack": "^5.11.1"
},
"devDependencies": {
"webpack-cli": "^4.3.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack -p",
"watch": "webpack --watch"
},
"author": "",
"license": "ISC"
}
Run Code Online (Sandbox Code Playgroud) 我从 github 克隆了一个存储库,然后使用 npm install 安装了 npm 软件包,但出现此错误
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/composition-api": "^1.0.0-rc.6",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"less": "^4.1.1",
"less-loader": "^8.0.0",
"node-sass": "^5.0.0",
"sass": "^1.32.6",
"sass-loader": "^7.3.1",
"url-loader": "^4.1.1",
"vue-template-compiler": "^2.6.11"
},
Run Code Online (Sandbox Code Playgroud)
我怎样才能摆脱这个问题?
我使用 CRA 方法(create-react-app),使用 npm install 为我的项目安装了不同的包,我没有使用其中的很多包,但手动检查项目中未使用哪些包,然后将其删除,这将是一个非常好的方法。困难的过程,有没有办法快速检查哪些包没有在我的项目中使用并删除它们?
我有一个简单的字母数组 我使用 for 循环在屏幕上显示字母 我想每六个字母添加到一个新行 我想达到这个结果
<script>
export default {
data() {
return {
alphabet: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
}
}
}
</script>
<template>
<ul>
<li v-for="(item, index) in alphabet" :key="index">
{{ item }}
</li>
</ul>
</template>
Run Code Online (Sandbox Code Playgroud) javascript ×3
npm ×3
node.js ×2
vuejs2 ×2
for-loop ×1
module ×1
npm-install ×1
package ×1
reactjs ×1
sass-loader ×1
vue.js ×1
webpack ×1