Q:

TypeError: Greeter.deployed(...).setGreeting is not a function

I start truffle console and type Greeter.deployed().setGreeting("Hello world!"); 
I receive the following error: 
TypeError: Greeter.deployed(...).setGreeting is not a function

How can I solve this issue?  Hoping your answer！Like the following diagram：

A:

Your code 
Greeter.deployed().setGreeting("Hello world!"); 

Does not work because .deployed() returns a Promise.  There's no setGreeting function on a Promise. 
Instead you should do
Greeter.deployed().then(instance => {
  instance.setGreeting("hello world");
});

You can type it in one line Greeter.deployed().then(i=>i.setGreeting("hello world"))

