'lightercollective'不被识别为内部或外部命令,可操作程序或批处理文件

时间:2019-01-08 09:28:01

标签: javascript node.js webpack package.json

我现在已经安装了webpack,我正在尝试安装webpack-cli,但是发生以下错误:

    $ npm i --save-dev webpack-cli

    > webpack-cli@3.2.1 postinstall D:\Development\Practices\sample\starter\node_modules\webpack-cli
    > lightercollective

    'lightercollective' is not recognized as an internal or external command, 
    operable program or batch file.
    npm WARN starter@1.0.0 No description
    npm WARN starter@1.0.0 No repository field.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! webpack-cli@3.2.1 postinstall: `lightercollective`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the webpack-cli@3.2.1 postinstall 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!     C:\Users\rajan\AppData\Roaming\npm-cache\_logs\2019-01-08T08_45_44_898Z-debug.log

注释:

  • 我尝试重新启动命令行。
  • 我也尝试过npm cache clean --force
  • 然后搜索大约一个小时。
  • 最后,以上消息中的 lightercollective被识别为什么。是什么意思?困惑???

3 个答案:

答案 0 :(得分:1)

安装:

npm i -g lightercollective

它们会更改内容...您必须在获取软件包时指定版本号,否则将来如果发生重大更改将无法使用。

答案 1 :(得分:0)

您可以将lightercollective添加到依赖项中以解决此问题。

Official package page

"lightercollective": "^0.0.0"

答案 2 :(得分:0)

更新webpack-cli:npm update webpack-cli --save-dev

在我的情况下,我从3.2.1(警告“ lightercollective”)变为3.3.8。似乎问题已解决。