Magento 2 Grunt - package.json 和 grunt 文件

Magento 2 Grunt - package.json and grunt file

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

下面是两个问题:

  1. 在 magento 2 目录 运行 npm install 之后

    npm install

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

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

    npm WARN html No description

    npm WARN html No repository field.

    npm WARN html No README data

    npm WARN html No license field.

    up to date in 0.089s

  2. 检查 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

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

  1. 重命名您的 magento 2 根目录中的这三个文件

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

我希望这对某人有所帮助并节省时间。