我是刚接触框架的人。我按照以下网址中描述的步骤进行安装。
https://grind.rocks/docs/0.7/guides/installation
安装成功完成,当我尝试使用以下命令运行该项目时,它给了我致命错误,如下所述。
命令:
$ bin / cli watch
错误:
Mac-iMac-1s-iMac:project-name Mac-imac-1$ bin/cli watch
Watching app,config
Failed to start Error: Plugin 0 specified in "/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-preset-grind/index.js" provided an invalid property of "default" (While processing preset: "/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-preset-grind/index.js")
at Plugin.init (/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/plugin.js:131:13)
at Function.normalisePlugin (/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:152:12)
at /Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at /Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
at /Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/Users/Mac-imac-1/Desktop/demoes/project-name/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
答案 0 :(得分:1)
我已经遇到了这个问题,因此我认为您必须按照以下说明更改软件包版本。
在package.json文件中找到“ devDependencies”部分,您可以看到“ babel-preset-grind”:“ ^ 0.8.0-beta.1”。我们需要删除该软件包的Beta版本。
“ babel-preset-grind”:“ ^ 0.8.0-beta.1”到“ babel-preset-grind”:“ 0.7.0”
然后需要从终端执行以下命令。
$ npm install
$bin/cli watch