【问题标题】:npm install error - SKIPPING OPTIONAL DEPENDENCYnpm 安装错误 - 跳过可选依赖项
【发布时间】:2019-06-15 11:44:34
【问题描述】:

我正在尝试使用 laragon 学习 laravel 在线课程。我需要运行命令npm install,但它标记了一个错误,我不知道如何修复它。

我尝试修改路径,但没有成功

C:\laragon\www\social>npm 安装 "CALL "C:\laragon\nodejs\\node.exe" "C:\laragon\nodejs\\node_modules\npm\bin\npm-cli.js" 前缀 -g" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable。 > node-sass@4.11.0 安装 C:\laragon\www\social\node_modules\node-sass > 节点脚本/install.js npm WARN ajv-keywords@3.2.0 需要一个对等的 ajv@^6.0.0 但没有安装。您必须自己安装对等依赖项。 npm WARN img-loader@3.0.1 需要一个 imagemin@^5.0.0 || ^6.0.0 但没有安装。您必须自己安装对等依赖项。 npm WARN 可选跳过可选依赖:fsevents@1.2.7 (node_modules\fsevents): npm WARN notsup 跳过可选依赖:fsevents@1.2.7 不受支持的平台:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch": "x64"}) npm 错误!文件 C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm npm 错误!路径 C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm npm 错误!代码生命周期 npm 错误!错误号 ENOENT npm 错误!系统调用产生 C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm npm 错误! node-sass@4.11.0 安装:`node scripts/install.js` npm 错误!生成 C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm ENOENT npm 错误! npm 错误!在 node-sass@4.11.0 安装脚本中失败。 npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。 npm 错误!可以在以下位置找到此运行的完整日志: npm 错误! C:\Users\Caribay\AppData\Roaming\npm-cache\_logs\2019-01-22T03_32_49_327Z-debug.log

我希望这个命令可以正常工作,但它会标记这些错误,请帮助我

P.S:我在一台装有 Windows 7 家庭高级版的笔记本电脑上工作。

【问题讨论】:

    标签: laravel laragon


    【解决方案1】:
    1. $ npm cache clean --force
    2. 删除 node_modules by $ rm -rf node_modules
    3. $ npm install

    然后用$ npm start重新开始

    【讨论】:

      【解决方案2】:

      我认为你应该手动安装 ajv 包或者如果你已经有一个较低的版本,将它更新到 6.0 版本

      npm i ajv

      我也有类似的问题。更新后它工作正常。尝试对其他错误也这样做。

      【讨论】:

      • 这个答案有效,但现在我有另一个问题,当我再次使用 npm install 时,会发生这种情况 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents): npm WARN notsup SKIPPING可选依赖:fsevents@1.2.7 不受支持的平台:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch":"x64"} )
      • fsevents 适用于 MacOS,请参阅 npmjs.com/package/fsevents。您使用的是 Windows
      猜你喜欢
      • 1970-01-01
      • 2018-02-01
      • 2020-04-02
      • 2019-08-06
      • 1970-01-01
      • 1970-01-01
      • 2016-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多