首页 > 解决方案 > npm 说“未安装 webpack 安装 webpack 以开始捆绑”,即使我已经安装了 webpack

问题描述

我正在尝试按照此处的说明使用 CSS 模块和 Webpack 制作网页。在我运行之前我很好npm start,然后这是它给我的错误:

> css-modules@1.0.0 start /Users/username/Desktop/css-modules
> webpack && open index.html


webpack not installed

Install webpack to start bundling: 
  $ npm install --save-dev webpack

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! css-modules@1.0.0 start: `webpack && open index.html`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the css-modules@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/username/.npm/_logs/2020-05-06T04_09_47_528Z-debug.log

…即使我已经安装了 webpack。

我应该怎么办?

标签: cssreactjsnpmwebpackcommand-line-interface

解决方案


推荐阅读