laravel npm 安装错误 - 跳过可选依赖项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54300915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:15:37  来源:igfitidea点击:

npm install error - SKIPPING OPTIONAL DEPENDENCY

laravellaragon

提问by Emmanuel Tamburini

I'm trying to follow an online course of laravel with laragon. I need to run the command npm install, but it marks an error and I don't know how to fix it.

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

I tried to modify the path but that did not work

我试图修改路径,但没有奏效

C:\laragon\www\social>npm install
"CALL "C:\laragon\nodejs\node.exe" "C:\laragon\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

> [email protected] install C:\laragon\www\social\node_modules\node-sass
> node scripts/install.js

npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of imagemin@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! file C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! path C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm
npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Users\Caribay\Anaconda3\Library\bin\graphviz;C:\Users\Caribay\AppData\Roaming\npm ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install 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\Caribay\AppData\Roaming\npm-cache\_logs19-01-22T03_32_49_327Z-debug.log

I hope with this command works correctly but it marks these errors, help me, please

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

P.S: I work on a laptop with windows 7 home premium.

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

回答by rize

  1. $ npm cache clean --force
  2. delete node_modulesby $ rm -rf node_modules
  3. $ npm install
  1. $ npm cache clean --force
  2. 删除node_modules通过$ rm -rf node_modules
  3. $ npm install

And then start it again with $ npm start

然后重新开始 $ npm start

回答by Anand Mainali

I think you should install manually ajv package or update it to version 6.0 if you already have a lower version

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

npm i ajv

npm i ajv

i had a similar issue. after updating it works fine. Try doing same for other errors also.

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