简体   繁体   English

在 Laravel 6 中安装 npm 包的问题

[英]issue in installing npm package in Laravel 6

I am new here installing laravel "npm package" with npm install command but it throws this error:我是这里的新手,使用npm install命令安装 laravel “npm 包” ,但会引发此错误:

'npm' is not recognized as an internal or external command, operable program or batch file. 'npm' 不是内部或外部命令,也不是可运行的程序或批处理文件。

My command:我的命令:

C:\xampp\htdocs\project>npm install

您必须安装nodejs ,然后才能使用npm

Just Download and Install Node.js from here https://nodejs.org/en/只需从这里下载并安装 Node.js https://nodejs.org/en/

If you run the downloaded file and install it, they will automatically configure for your system如果您运行下载的文件并安装它,它们将自动为您的系统配置

You don't need any other configurations anymore, now you can use the npm command anywhere您不再需要任何其他配置,现在您可以在任何地方使用npm命令


Still ERROR?还是错误?

Follow the steps:按照步骤:

  1. Go to My Computer Properties转到我的电脑属性
  2. Click Advanced System Setting点击高级系统设置
  3. Click Advanced单击高级
  4. Then, Click Environment Variable button然后,单击环境变量按钮
  5. Now you have Environment variable window: From System Variable , Select Path现在你有环境变量窗口:从系统变量,选择路径
  6. Click Edit单击编辑
  7. At the end of the Variable value, add ;C:\\Program Files\\nodejs\\在变量值的末尾,添加;C:\\Program Files\\nodejs\\

Now you can use the npm command anywhere现在你可以在任何地方使用npm命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM