Magento 2 Grunt - package.json和grunt文件

时间:2021-12-24 07:21:45

I had problem with Grunt installation with Magento 2.

我在使用Magento 2安装Grunt时遇到了问题。

Below are the two issues:

以下是两个问题:

  1. After running npm install in magento 2 directory

    在magento 2目录中运行npm install之后

    npm install

    npm安装

    npm WARN saveError ENOENT: no such file or directory, open '/var/www/html/package.json'

    npm WARN saveError ENOENT:没有这样的文件或目录,打开'/var/www/html/package.json'

    npm WARN enoent ENOENT: no such file or directory, open '/var/www/html/package.json'

    npm WARN enoent ENOENT:没有这样的文件或目录,打开'/var/www/html/package.json'

    npm WARN html No description

    npm WARN html没有描述

    npm WARN html No repository field.

    npm WARN html没有存储库字段。

    npm WARN html No README data

    npm WARN html没有README数据

    npm WARN html No license field.

    npm WARN html没有许可证字段。

    up to date in 0.089s

    最新的0.089s

  2. Checking grunt - grunt clean:blank

    检查咕噜声 - 咕噜声干净:空白

    grunt clean:blank

    咕噜咕噜:空白

    A valid Gruntfile could not be found. Please see the getting started guide for more information on how to configure grunt: http://gruntjs.com/getting-started

    找不到有效的Gruntfile。有关如何配置grunt的更多信息,请参阅入门指南:http://gruntjs.com/getting-started

1 个解决方案

#1


0  

After reading a few tutorials I missed these things:

在阅读了一些教程后,我错过了这些东西:

  1. Rename these three files in your magento 2 root directory

    在magento 2根目录中重命名这三个文件

    • package.json.sample => package.json
    • package.json.sample => package.json
    • grunt.js.sample => grunt.js
    • grunt.js.sample => grunt.js
    • grunt-config.js.sample => grunt-config.js
    • grunt-config.js.sample => grunt-config.js

I hope this help someone and save time.

我希望这可以帮助别人并节省时间。

#1


0  

After reading a few tutorials I missed these things:

在阅读了一些教程后,我错过了这些东西:

  1. Rename these three files in your magento 2 root directory

    在magento 2根目录中重命名这三个文件

    • package.json.sample => package.json
    • package.json.sample => package.json
    • grunt.js.sample => grunt.js
    • grunt.js.sample => grunt.js
    • grunt-config.js.sample => grunt-config.js
    • grunt-config.js.sample => grunt-config.js

I hope this help someone and save time.

我希望这可以帮助别人并节省时间。