0
我想創建一個自耕農發生器(它已經published on npm),但我已經打了幾個障礙。約曼找不到發電機
我不知道這是否與我的節點設置或代碼。我troubleshooted與一對夫婦的類似問題的幫助:
- Generators installed while using NVM are not showing in Yo generators list
- UNMET PEER DEPENDENCY [email protected]>=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.