Yeoman 找不到生成器
Yeoman cannot find generator
我正在尝试创建一个 yeoman 生成器(它已经 published on npm),但我遇到了一些障碍。
我不确定这是否与我的节点设置或代码有关。我已经在几个类似问题的帮助下进行了故障排除:
- Generators installed while using NVM are not showing in Yo generators list
- UNMET PEER DEPENDENCY yo@>=1.0.0
我可以成功 运行 其他生成器,所以我相当确定,在这一点上,这是一个代码问题。
生成器与 yo
一起安装。
$ nvm use 7
Now using node v7.7.4 (npm v4.1.2)
$ npm install -g generator-spike yo
$ ls /Users/developer/.nvm/versions/node/v7.7.4/lib/node_modules
generator-generator generator-spike http-server npm yarn yo
$ ls /Users/developer/.nvm/versions/node/v7.7.4/lib/node_modules/generator-spike
README.md actions app base.js node_modules package.json
哟安装正确。
$ yo doctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
Yeoman 找到发电机。
$ yo --generators
Available Generators:
generator
subgenerator
spike
actions
但是你不能 运行 生成器:
$ yo spike:actions -f yada
Error spike:actions -f yada
You don’t seem to have a generator with the name “spike:actions” installed.
But help is on the way:
You can see available generators via npm search yeoman-generator or via http://yeoman.io/generators/.
Install them with npm install generator-spike:actions.
To see all your installed generators run yo without any arguments. Adding the --help option will also show subgenerators.
If yo cannot find the generator, run yo doctor to troubleshoot your system.
Yeoman 不支持 ES6 export default
。使用 module.exports =
.
从'path'导入路径;
从 '../base' 导入 Base;
module.exports = class Actions extends Base {
// ...
}
我正在尝试创建一个 yeoman 生成器(它已经 published on npm),但我遇到了一些障碍。
我不确定这是否与我的节点设置或代码有关。我已经在几个类似问题的帮助下进行了故障排除:
- Generators installed while using NVM are not showing in Yo generators list
- UNMET PEER DEPENDENCY yo@>=1.0.0
我可以成功 运行 其他生成器,所以我相当确定,在这一点上,这是一个代码问题。
生成器与 yo
一起安装。
$ nvm use 7
Now using node v7.7.4 (npm v4.1.2)
$ npm install -g generator-spike yo
$ ls /Users/developer/.nvm/versions/node/v7.7.4/lib/node_modules
generator-generator generator-spike http-server npm yarn yo
$ ls /Users/developer/.nvm/versions/node/v7.7.4/lib/node_modules/generator-spike
README.md actions app base.js node_modules package.json
哟安装正确。
$ yo doctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
Yeoman 找到发电机。
$ yo --generators
Available Generators:
generator
subgenerator
spike
actions
但是你不能 运行 生成器:
$ yo spike:actions -f yada
Error spike:actions -f yada
You don’t seem to have a generator with the name “spike:actions” installed.
But help is on the way:
You can see available generators via npm search yeoman-generator or via http://yeoman.io/generators/.
Install them with npm install generator-spike:actions.
To see all your installed generators run yo without any arguments. Adding the --help option will also show subgenerators.
If yo cannot find the generator, run yo doctor to troubleshoot your system.
Yeoman 不支持 ES6 export default
。使用 module.exports =
.
从'path'导入路径; 从 '../base' 导入 Base;
module.exports = class Actions extends Base {
// ...
}